<?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=Ad5215</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=Ad5215"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Ad5215"/>
	<updated>2026-04-04T08:16:55Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687478</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687478"/>
		<updated>2018-03-14T10:06:17Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;&#039;&#039;Equilibrium separation and well depth&#039;&#039;&amp;lt;\span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;&#039;&#039;Integrals&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*Nevery (100) = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
*Nrepeat (1000) = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
*Nfreq (100,000) = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Food constitutes a huge part of our lives, whether we actively think about it or not. Cooking, in some form or other, has been around ever since the first human realised that fire makes raw meat tastier and more convenient to eat. Nowadays, the food industry is enormous and cooking has become a successful blend of art and science. Perhaps the most pertinent example of this is molecular gastronomy, a subdiscipline of food science that seeks to investigate the physical and chemical transformations of ingredients during the cooking process. In their review, Balham et al refer to molecular gastronomy as an &amp;quot;emerging scientific discipline&amp;quot;.&amp;lt;ref&amp;gt;P. Barham, L. H. Skibsted, W. L. P. Bredie and J. Risbo, &#039;&#039;Symp.&lt;br /&gt;
A Q. J. Mod. Foreign Lit.&#039;&#039;, 2010, 2313–2365.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In fact, molecular gastronomy relies heavily on processes such as gelification and infusion and on materials such as gels, foams and powders. It also uses equipment that is heavily reminiscent of a laboratory - some kitchens are fitted with butane burners, syringes and dehydrators.  &lt;br /&gt;
&lt;br /&gt;
Clever presentations and unusual sensations and are piquing the interest of many people; in some places, molecular gastronomy restaurants have become tourist attractions.&amp;lt;ref&amp;gt;D. Tüzünkan and A. Albayrak, &#039;&#039;Procedia&lt;br /&gt;
- Soc. Behav. Sci.&#039;&#039;, 2015, &#039;&#039;&#039;195&#039;&#039;&#039;, 446–452.&amp;lt;/ref&amp;gt; Simulating the thermodynamic properties of systems can provide a better understanding of physical systems and can lead to the growth and development of this industry.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;P. Atkins, J. De Paula, &#039;&#039;Physical&lt;br /&gt;
Chemistry&#039;&#039;, OUP Oxford, 9th edn., 2009.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram&amp;lt;ref&amp;gt;J. P. Hansen and L.&lt;br /&gt;
Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151–161.&amp;lt;/ref&amp;gt; reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;O. J. Eder, &#039;&#039;J. Chem. Phys.&#039;&#039;, 1977, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866–3870.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions or by interactions with other particles; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero and the velocities to be uncorrelated. &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time: the velocity goes from an initial state to an uncorrelated one and then back to the initial state. The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. This is because in a solid the atoms have fixed positions in a lattice; the forces between the particles are strong and these will oscillate in place for a while. The VACF takes much longer to reach zero than in the case of a liquid or a gas. The gas VACF tends slowly to zero; the interactions between particles in a gas are minimal, which means that the velocity at time is not very different from an initial velocity. A liquid is somewhere in-between these two phases: the particles have more freedom of movement than they do in a solid, but the attractive forces are strong enough to cause a perturbation in the velocities; the VACF shows a very slight oscillation, but then quickly dampens to zero. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
This lab provided insight into the thermodynamic properties of systems and how these change with phase, temperature, pressure. Of course, the systems investigated were small, but modeling larger, more complicated systems is possible and could prove useful. A particular domain where this kind of research would be invaluable is, as previously mentioned, molecular gastronomy: understanding phase changes and the properties of liquids, solids and gels can lead to the advancement of this (pseudo)-scientific discipline.&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687465</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687465"/>
		<updated>2018-03-14T10:01:40Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;&#039;&#039;Equilibrium separation and well depth&#039;&#039;&amp;lt;\span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;&#039;&#039;Integrals&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*Nevery (100) = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
*Nrepeat (1000) = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
*Nfreq (100,000) = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Food constitutes a huge part of our lives, whether we actively think about it or not. Cooking, in some form or other, has been around ever since the first human realised that fire makes raw meat tastier and more convenient to eat. Nowadays, the food industry is enormous and cooking has become a successful blend of art and science. Perhaps the most pertinent example of this is molecular gastronomy, a subdiscipline of food science that seeks to investigate the physical and chemical transformations of ingredients during the cooking process. In their review, Balham et al refer to molecular gastronomy as an &amp;quot;emerging scientific discipline&amp;quot;.&amp;lt;ref&amp;gt;P. Barham, L. H. Skibsted, W. L. P. Bredie and J. Risbo, &#039;&#039;Symp.&lt;br /&gt;
A Q. J. Mod. Foreign Lit.&#039;&#039;, 2010, 2313–2365.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In fact, molecular gastronomy relies heavily on processes such as gelification and infusion and on materials such as gels, foams and powders. It also uses equipment that is heavily reminiscent of a laboratory - some kitchens are fitted with butane burners, syringes and dehydrators.  &lt;br /&gt;
&lt;br /&gt;
Clever presentations and unusual sensations and are piquing the interest of many people; in some places, molecular gastronomy restaurants have become tourist attractions.&amp;lt;ref&amp;gt;D. Tüzünkan and A. Albayrak, &#039;&#039;Procedia&lt;br /&gt;
- Soc. Behav. Sci.&#039;&#039;, 2015, &#039;&#039;&#039;195&#039;&#039;&#039;, 446–452.&amp;lt;/ref&amp;gt; Simulating the thermodynamic properties of systems can provide a better understanding of physical systems and can lead to the growth and development of this industry.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;P. Atkins, J. De Paula, &#039;&#039;Physical&lt;br /&gt;
Chemistry&#039;&#039;, OUP Oxford, 9th edn., 2009.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;O. J. Eder, &#039;&#039;J. Chem. Phys.&#039;&#039;, 1977, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866–3870.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions or by interactions with other particles; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero and the velocities to be uncorrelated. &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time: the velocity goes from an initial state to an uncorrelated one and then back to the initial state. The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. This is because in a solid the atoms have fixed positions in a lattice; the forces between the particles are strong and these will oscillate in place for a while. The VACF takes much longer to reach zero than in the case of a liquid or a gas. The gas VACF tends slowly to zero; the interactions between particles in a gas are minimal, which means that the velocity at time is not very different from an initial velocity. A liquid is somewhere in-between these two phases: the particles have more freedom of movement than they do in a solid, but the attractive forces are strong enough to cause a perturbation in the velocities; the VACF shows a very slight oscillation, but then quickly dampens to zero. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
This lab provided insight into the thermodynamic properties of systems and how these change with phase, temperature, pressure. Of course, the systems investigated were small, but modeling larger, more complicated systems is possible and could prove useful. A particular domain where this kind of research would be invaluable is, as previously mentioned, molecular gastronomy: understanding phase changes and the properties of liquids, solids and gels can lead to the advancement of this (pseudo)-scientific discipline.&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687321</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687321"/>
		<updated>2018-03-14T01:39:18Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Section 2: Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;&#039;&#039;Equilibrium separation and well depth&#039;&#039;&amp;lt;\span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;&#039;&#039;Integrals&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*Nevery (100) = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
*Nrepeat (1000) = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
*Nfreq (100,000) = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Food constitutes a huge part of our lives, whether we actively think about it or not. Cooking, in some form or other, has been around ever since the first human realised that fire makes raw meat tastier and more convenient to eat. Nowadays, the food industry is enormous and cooking has become a successful blend of art and science. Perhaps the most pertinent example of this is molecular gastronomy, a subdiscipline of food science that seeks to investigate the physical and chemical transformations of ingredients during the cooking process. In their review, Balham et al refer to molecular gastronomy as an &amp;quot;emerging scientific discipline&amp;quot;.&amp;lt;ref&amp;gt;P. Barham, L. H. Skibsted, W. L. P. Bredie and J. Risbo, &#039;&#039;Symp.&lt;br /&gt;
A Q. J. Mod. Foreign Lit.&#039;&#039;, 2010, 2313–2365.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In fact, molecular gastronomy relies heavily on processes such as gelification and infusion and on materials such as gels, foams and powders. It also uses equipment that is heavily reminiscent of a laboratory - some kitchens are fitted with butane burners, syringes and dehydrators.  &lt;br /&gt;
&lt;br /&gt;
Clever presentations and unusual sensations and are piquing the interest of many people; in some places, molecular gastronomy restaurants have become tourist attractions.&amp;lt;ref&amp;gt;D. Tüzünkan and A. Albayrak, &#039;&#039;Procedia&lt;br /&gt;
- Soc. Behav. Sci.&#039;&#039;, 2015, &#039;&#039;&#039;195&#039;&#039;&#039;, 446–452.&amp;lt;/ref&amp;gt; Simulating the thermodynamic properties of systems can provide a better understanding of physical systems and can lead to the growth and development of this industry.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;P. Atkins, J. De Paula, &#039;&#039;Physical&lt;br /&gt;
Chemistry&#039;&#039;, OUP Oxford, 9th edn., 2009.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;O. J. Eder, &#039;&#039;J. Chem. Phys.&#039;&#039;, 1977, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866–3870.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions or by interactions with other particles; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero and the velocities to be uncorrelated. &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time: the velocity goes from an initial state to an uncorrelated one and then back to the initial state. The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. This is because in a solid the atoms have fixed positions in a lattice; the forces between the particles are strong and these will oscillate in place for a while. The VACF takes much longer to reach zero than in the case of a liquid or a gas. The gas VACF tends slowly to zero; the interactions between particles in a gas are minimal, which means that the velocity at time is not very different from an initial velocity. A liquid is somewhere in-between these two phases: the particles have more freedom of movement than they do in a solid, but the attractive forces are strong enough to cause a perturbation in the velocities; the VACF shows a very slight oscillation, but then quickly dampens to zero. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
This lab provided insight into the thermodynamic properties of systems and how these change with phase, temperature, pressure. Of course, the systems investigated were small, but modeling larger, more complicated systems is possible and could prove useful. A particular domain where this kind of research would be invaluable is, as previously mentioned, molecular gastronomy: understanding phase changes and the properties of liquids, solids and gels can lead to the advancement of this (pseudo)-scientific discipline.&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687320</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687320"/>
		<updated>2018-03-14T01:37:18Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The Radial Distribution Function (RDF) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*Nevery (100) = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
*Nrepeat (1000) = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
*Nfreq (100,000) = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Food constitutes a huge part of our lives, whether we actively think about it or not. Cooking, in some form or other, has been around ever since the first human realised that fire makes raw meat tastier and more convenient to eat. Nowadays, the food industry is enormous and cooking has become a successful blend of art and science. Perhaps the most pertinent example of this is molecular gastronomy, a subdiscipline of food science that seeks to investigate the physical and chemical transformations of ingredients during the cooking process. In their review, Balham et al refer to molecular gastronomy as an &amp;quot;emerging scientific discipline&amp;quot;.&amp;lt;ref&amp;gt;P. Barham, L. H. Skibsted, W. L. P. Bredie and J. Risbo, &#039;&#039;Symp.&lt;br /&gt;
A Q. J. Mod. Foreign Lit.&#039;&#039;, 2010, 2313–2365.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In fact, molecular gastronomy relies heavily on processes such as gelification and infusion and on materials such as gels, foams and powders. It also uses equipment that is heavily reminiscent of a laboratory - some kitchens are fitted with butane burners, syringes and dehydrators.  &lt;br /&gt;
&lt;br /&gt;
Clever presentations and unusual sensations and are piquing the interest of many people; in some places, molecular gastronomy restaurants have become tourist attractions.&amp;lt;ref&amp;gt;D. Tüzünkan and A. Albayrak, &#039;&#039;Procedia&lt;br /&gt;
- Soc. Behav. Sci.&#039;&#039;, 2015, &#039;&#039;&#039;195&#039;&#039;&#039;, 446–452.&amp;lt;/ref&amp;gt; Simulating the thermodynamic properties of systems can provide a better understanding of physical systems and can lead to the growth and development of this industry.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;P. Atkins, J. De Paula, &#039;&#039;Physical&lt;br /&gt;
Chemistry&#039;&#039;, OUP Oxford, 9th edn., 2009.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;O. J. Eder, &#039;&#039;J. Chem. Phys.&#039;&#039;, 1977, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866–3870.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions or by interactions with other particles; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero and the velocities to be uncorrelated. &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time: the velocity goes from an initial state to an uncorrelated one and then back to the initial state. The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. This is because in a solid the atoms have fixed positions in a lattice; the forces between the particles are strong and these will oscillate in place for a while. The VACF takes much longer to reach zero than in the case of a liquid or a gas. The gas VACF tends slowly to zero; the interactions between particles in a gas are minimal, which means that the velocity at time is not very different from an initial velocity. A liquid is somewhere in-between these two phases: the particles have more freedom of movement than they do in a solid, but the attractive forces are strong enough to cause a perturbation in the velocities; the VACF shows a very slight oscillation, but then quickly dampens to zero. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
This lab provided insight into the thermodynamic properties of systems and how these change with phase, temperature, pressure. Of course, the systems investigated were small, but modeling larger, more complicated systems is possible and could prove useful. A particular domain where this kind of research would be invaluable is, as previously mentioned, molecular gastronomy: understanding phase changes and the properties of liquids, solids and gels can lead to the advancement of this (pseudo)-scientific discipline.&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687319</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687319"/>
		<updated>2018-03-14T01:36:42Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*Nevery (100) = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
*Nrepeat (1000) = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
*Nfreq (100,000) = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Food constitutes a huge part of our lives, whether we actively think about it or not. Cooking, in some form or other, has been around ever since the first human realised that fire makes raw meat tastier and more convenient to eat. Nowadays, the food industry is enormous and cooking has become a successful blend of art and science. Perhaps the most pertinent example of this is molecular gastronomy, a subdiscipline of food science that seeks to investigate the physical and chemical transformations of ingredients during the cooking process. In their review, Balham et al refer to molecular gastronomy as an &amp;quot;emerging scientific discipline&amp;quot;.&amp;lt;ref&amp;gt;P. Barham, L. H. Skibsted, W. L. P. Bredie and J. Risbo, &#039;&#039;Symp.&lt;br /&gt;
A Q. J. Mod. Foreign Lit.&#039;&#039;, 2010, 2313–2365.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In fact, molecular gastronomy relies heavily on processes such as gelification and infusion and on materials such as gels, foams and powders. It also uses equipment that is heavily reminiscent of a laboratory - some kitchens are fitted with butane burners, syringes and dehydrators.  &lt;br /&gt;
&lt;br /&gt;
Clever presentations and unusual sensations and are piquing the interest of many people; in some places, molecular gastronomy restaurants have become tourist attractions.&amp;lt;ref&amp;gt;D. Tüzünkan and A. Albayrak, &#039;&#039;Procedia&lt;br /&gt;
- Soc. Behav. Sci.&#039;&#039;, 2015, &#039;&#039;&#039;195&#039;&#039;&#039;, 446–452.&amp;lt;/ref&amp;gt; Simulating the thermodynamic properties of systems can provide a better understanding of physical systems and can lead to the growth and development of this industry.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;P. Atkins, J. De Paula, &#039;&#039;Physical&lt;br /&gt;
Chemistry&#039;&#039;, OUP Oxford, 9th edn., 2009.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;O. J. Eder, &#039;&#039;J. Chem. Phys.&#039;&#039;, 1977, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866–3870.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions or by interactions with other particles; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero and the velocities to be uncorrelated. &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time: the velocity goes from an initial state to an uncorrelated one and then back to the initial state. The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. This is because in a solid the atoms have fixed positions in a lattice; the forces between the particles are strong and these will oscillate in place for a while. The VACF takes much longer to reach zero than in the case of a liquid or a gas. The gas VACF tends slowly to zero; the interactions between particles in a gas are minimal, which means that the velocity at time is not very different from an initial velocity. A liquid is somewhere in-between these two phases: the particles have more freedom of movement than they do in a solid, but the attractive forces are strong enough to cause a perturbation in the velocities; the VACF shows a very slight oscillation, but then quickly dampens to zero. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
This lab provided insight into the thermodynamic properties of systems and how these change with phase, temperature, pressure. Of course, the systems investigated were small, but modeling larger, more complicated systems is possible and could prove useful. A particular domain where this kind of research would be invaluable is, as previously mentioned, molecular gastronomy: understanding phase changes and the properties of liquids, solids and gels can lead to the advancement of this (pseudo)-scientific discipline.&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687318</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687318"/>
		<updated>2018-03-14T01:36:00Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The diffusion coefficient, D */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*Nevery (100) = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
*Nrepeat (1000) = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
*Nfreq (100,000) = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Food constitutes a huge part of our lives, whether we actively think about it or not. Cooking, in some form or other, has been around ever since the first human realised that fire makes raw meat tastier and more convenient to eat. Nowadays, the food industry is enormous and cooking has become a successful blend of art and science. Perhaps the most pertinent example of this is molecular gastronomy, a subdiscipline of food science that seeks to investigate the physical and chemical transformations of ingredients during the cooking process. In their review, Balham et al refer to molecular gastronomy as an &amp;quot;emerging scientific discipline&amp;quot;.&amp;lt;ref&amp;gt;P. Barham, L. H. Skibsted, W. L. P. Bredie and J. Risbo, &#039;&#039;Symp.&lt;br /&gt;
A Q. J. Mod. Foreign Lit.&#039;&#039;, 2010, 2313–2365.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In fact, molecular gastronomy relies heavily on processes such as gelification and infusion and on materials such as gels, foams and powders. It also uses equipment that is heavily reminiscent of a laboratory - some kitchens are fitted with butane burners, syringes and dehydrators.  &lt;br /&gt;
&lt;br /&gt;
Clever presentations and unusual sensations and are piquing the interest of many people; in some places, molecular gastronomy restaurants have become tourist attractions.&amp;lt;ref&amp;gt;D. Tüzünkan and A. Albayrak, &#039;&#039;Procedia&lt;br /&gt;
- Soc. Behav. Sci.&#039;&#039;, 2015, &#039;&#039;&#039;195&#039;&#039;&#039;, 446–452.&amp;lt;/ref&amp;gt; Simulating the thermodynamic properties of systems can provide a better understanding of physical systems and can lead to the growth and development of this industry.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;P. Atkins, J. De Paula, &#039;&#039;Physical&lt;br /&gt;
Chemistry&#039;&#039;, OUP Oxford, 9th edn., 2009.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;O. J. Eder, &#039;&#039;J. Chem. Phys.&#039;&#039;, 1977, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866–3870.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions or by interactions with other particles; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero and the velocities to be uncorrelated. &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time: the velocity goes from an initial state to an uncorrelated one and then back to the initial state. The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. This is because in a solid the atoms have fixed positions in a lattice; the forces between the particles are strong and these will oscillate in place for a while. The VACF takes much longer to reach zero than in the case of a liquid or a gas. The gas VACF tends slowly to zero; the interactions between particles in a gas are minimal, which means that the velocity at time is not very different from an initial velocity. A liquid is somewhere in-between these two phases: the particles have more freedom of movement than they do in a solid, but the attractive forces are strong enough to cause a perturbation in the velocities; the VACF shows a very slight oscillation, but then quickly dampens to zero. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
This lab provided insight into the thermodynamic properties of systems and how these change with phase, temperature, pressure. Of course, the systems investigated were small, but modeling larger, more complicated systems is possible and could prove useful. A particular domain where this kind of research would be invaluable is, as previously mentioned, molecular gastronomy: understanding phase changes and the properties of liquids, solids and gels can lead to the advancement of this (pseudo)-scientific discipline, with numerous applications in day-to-day life. Molecular gastronomy is an industry on the rise; perhaps in twenty or fifty years the classic Sunday roast will be replaced by a mixture of flavoured foams, gels and powders.&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687300</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687300"/>
		<updated>2018-03-14T00:52:33Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*Nevery (100) = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
*Nrepeat (1000) = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
*Nfreq (100,000) = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Food constitutes a huge part of our lives, whether we actively think about it or not. Cooking, in some form or other, has been around ever since the first human realised that fire makes raw meat tastier and more convenient to eat. Nowadays, the food industry is enormous and cooking has become a successful blend of art and science. Perhaps the most pertinent example of this is molecular gastronomy, a subdiscipline of food science that seeks to investigate the physical and chemical transformations of ingredients during the cooking process. In their review, Balham et al refer to molecular gastronomy as an &amp;quot;emerging scientific discipline&amp;quot;.&amp;lt;ref&amp;gt;P. Barham, L. H. Skibsted, W. L. P. Bredie and J. Risbo, &#039;&#039;Symp.&lt;br /&gt;
A Q. J. Mod. Foreign Lit.&#039;&#039;, 2010, 2313–2365.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In fact, molecular gastronomy relies heavily on processes such as gelification and infusion and on materials such as gels, foams and powders. It also uses equipment that is heavily reminiscent of a laboratory - some kitchens are fitted with butane burners, syringes and dehydrators.  &lt;br /&gt;
&lt;br /&gt;
Clever presentations and unusual sensations and are piquing the interest of many people; in some places, molecular gastronomy restaurants have become tourist attractions.&amp;lt;ref&amp;gt;D. Tüzünkan and A. Albayrak, &#039;&#039;Procedia&lt;br /&gt;
- Soc. Behav. Sci.&#039;&#039;, 2015, &#039;&#039;&#039;195&#039;&#039;&#039;, 446–452.&amp;lt;/ref&amp;gt; Simulating the thermodynamic properties of systems can provide a better understanding of physical systems and can lead to the growth and development of this industry.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;P. Atkins, J. De Paula, &#039;&#039;Physical&lt;br /&gt;
Chemistry&#039;&#039;, OUP Oxford, 9th edn., 2009.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;O. J. Eder, &#039;&#039;J. Chem. Phys.&#039;&#039;, 1977, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866–3870.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
This lab provided insight into the thermodynamic properties of systems and how these change with phase, temperature, pressure. Of course, the systems investigated were small, but modeling larger, more complicated systems is possible and could prove useful. A particular domain where this kind of research would be invaluable is, as previously mentioned, molecular gastronomy: understanding phase changes and the properties of liquids, solids and gels can lead to the advancement of this (pseudo)-scientific discipline, with numerous applications in day-to-day life. Molecular gastronomy is an industry on the rise; perhaps in twenty or fifty years the classic Sunday roast will be replaced by a mixture of flavoured foams, gels and powders.&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687297</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687297"/>
		<updated>2018-03-14T00:41:35Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Section 4: Running simulations under specific conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*Nevery (100) = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
*Nrepeat (1000) = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
*Nfreq (100,000) = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Food constitutes a huge part of our lives, whether we actively think about it or not. Cooking, even though not always as we know it today, has been around ever since the first human realised that fire makes raw meat tastier and more convenient to eat. Nowadays, the food industry is enormous and cooking has become a successful blend of art and science. Perhaps the most recent &amp;quot;trend&amp;quot; is molecular gastronomy: a subdiscipline of food science that seeks to investigate the physical and chemical transformations of ingredients during the cooking process. Balham et al. have published a review of the science behind molecular gastronomy in 2010.&amp;lt;ref&amp;gt;P. Barham, L. H. Skibsted, W. L. P. Bredie and J. Risbo, &#039;&#039;Symp.&lt;br /&gt;
A Q. J. Mod. Foreign Lit.&#039;&#039;, 2010, 2313–2365.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The term &amp;quot;science&amp;quot; may not be that far off, in fact, when refering to molecular gastronomy. The kitchen of such a &amp;quot;cook&amp;quot; looks more like a laboratory, populated with equipment such as butane burners, syringes and dehydrators. This discipline of gastronomy has led to outlandish dishes, from cocktails served as gellified spheres, to flavoured foams and powdered oils. The clever presentations and unusual sensations are piquing the interest of many people; in some places, molecular gastronomy restaurants have become tourist attractions.&amp;lt;ref&amp;gt;D. Tüzünkan and A. Albayrak, &#039;&#039;Procedia&lt;br /&gt;
- Soc. Behav. Sci.&#039;&#039;, 2015, &#039;&#039;&#039;195&#039;&#039;&#039;, 446–452.&amp;lt;/ref&amp;gt; Simulating the thermodynamic properties of systems can provide a better understanding of physical systems and can lead to the improvement and development of practices such as molecular gastronomy.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;P. Atkins, J. De Paula, &#039;&#039;Physical&lt;br /&gt;
Chemistry&#039;&#039;, OUP Oxford, 9th edn., 2009.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;O. J. Eder, &#039;&#039;J. Chem. Phys.&#039;&#039;, 1977, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866–3870.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
This lab provided insight into the thermodynamic properties of systems and how these change with phase, temperature, pressure. Of course, the systems investigated were small, but modeling larger, more complicated systems is possible and could prove useful. A particular domain where this kind of research would be invaluable is, as previously mentioned, molecular gastronomy: understanding phase changes and the properties of liquids, solids and gels can lead to the advancement of this (pseudo)-scientific discipline, with numerous applications in day-to-day life. Molecular gastronomy is an industry on the rise; perhaps in twenty or fifty years the classic Sunday roast will be replaced by a mixture of flavoured foams, gels and powders.&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687296</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687296"/>
		<updated>2018-03-14T00:41:07Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Section 4: Running simulations under specific conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
*Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
*Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Food constitutes a huge part of our lives, whether we actively think about it or not. Cooking, even though not always as we know it today, has been around ever since the first human realised that fire makes raw meat tastier and more convenient to eat. Nowadays, the food industry is enormous and cooking has become a successful blend of art and science. Perhaps the most recent &amp;quot;trend&amp;quot; is molecular gastronomy: a subdiscipline of food science that seeks to investigate the physical and chemical transformations of ingredients during the cooking process. Balham et al. have published a review of the science behind molecular gastronomy in 2010.&amp;lt;ref&amp;gt;P. Barham, L. H. Skibsted, W. L. P. Bredie and J. Risbo, &#039;&#039;Symp.&lt;br /&gt;
A Q. J. Mod. Foreign Lit.&#039;&#039;, 2010, 2313–2365.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The term &amp;quot;science&amp;quot; may not be that far off, in fact, when refering to molecular gastronomy. The kitchen of such a &amp;quot;cook&amp;quot; looks more like a laboratory, populated with equipment such as butane burners, syringes and dehydrators. This discipline of gastronomy has led to outlandish dishes, from cocktails served as gellified spheres, to flavoured foams and powdered oils. The clever presentations and unusual sensations are piquing the interest of many people; in some places, molecular gastronomy restaurants have become tourist attractions.&amp;lt;ref&amp;gt;D. Tüzünkan and A. Albayrak, &#039;&#039;Procedia&lt;br /&gt;
- Soc. Behav. Sci.&#039;&#039;, 2015, &#039;&#039;&#039;195&#039;&#039;&#039;, 446–452.&amp;lt;/ref&amp;gt; Simulating the thermodynamic properties of systems can provide a better understanding of physical systems and can lead to the improvement and development of practices such as molecular gastronomy.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;P. Atkins, J. De Paula, &#039;&#039;Physical&lt;br /&gt;
Chemistry&#039;&#039;, OUP Oxford, 9th edn., 2009.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;O. J. Eder, &#039;&#039;J. Chem. Phys.&#039;&#039;, 1977, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866–3870.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
This lab provided insight into the thermodynamic properties of systems and how these change with phase, temperature, pressure. Of course, the systems investigated were small, but modeling larger, more complicated systems is possible and could prove useful. A particular domain where this kind of research would be invaluable is, as previously mentioned, molecular gastronomy: understanding phase changes and the properties of liquids, solids and gels can lead to the advancement of this (pseudo)-scientific discipline, with numerous applications in day-to-day life. Molecular gastronomy is an industry on the rise; perhaps in twenty or fifty years the classic Sunday roast will be replaced by a mixture of flavoured foams, gels and powders.&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687294</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687294"/>
		<updated>2018-03-14T00:40:32Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Section 3: Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Food constitutes a huge part of our lives, whether we actively think about it or not. Cooking, even though not always as we know it today, has been around ever since the first human realised that fire makes raw meat tastier and more convenient to eat. Nowadays, the food industry is enormous and cooking has become a successful blend of art and science. Perhaps the most recent &amp;quot;trend&amp;quot; is molecular gastronomy: a subdiscipline of food science that seeks to investigate the physical and chemical transformations of ingredients during the cooking process. Balham et al. have published a review of the science behind molecular gastronomy in 2010.&amp;lt;ref&amp;gt;P. Barham, L. H. Skibsted, W. L. P. Bredie and J. Risbo, &#039;&#039;Symp.&lt;br /&gt;
A Q. J. Mod. Foreign Lit.&#039;&#039;, 2010, 2313–2365.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The term &amp;quot;science&amp;quot; may not be that far off, in fact, when refering to molecular gastronomy. The kitchen of such a &amp;quot;cook&amp;quot; looks more like a laboratory, populated with equipment such as butane burners, syringes and dehydrators. This discipline of gastronomy has led to outlandish dishes, from cocktails served as gellified spheres, to flavoured foams and powdered oils. The clever presentations and unusual sensations are piquing the interest of many people; in some places, molecular gastronomy restaurants have become tourist attractions.&amp;lt;ref&amp;gt;D. Tüzünkan and A. Albayrak, &#039;&#039;Procedia&lt;br /&gt;
- Soc. Behav. Sci.&#039;&#039;, 2015, &#039;&#039;&#039;195&#039;&#039;&#039;, 446–452.&amp;lt;/ref&amp;gt; Simulating the thermodynamic properties of systems can provide a better understanding of physical systems and can lead to the improvement and development of practices such as molecular gastronomy.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;P. Atkins, J. De Paula, &#039;&#039;Physical&lt;br /&gt;
Chemistry&#039;&#039;, OUP Oxford, 9th edn., 2009.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;O. J. Eder, &#039;&#039;J. Chem. Phys.&#039;&#039;, 1977, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866–3870.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
This lab provided insight into the thermodynamic properties of systems and how these change with phase, temperature, pressure. Of course, the systems investigated were small, but modeling larger, more complicated systems is possible and could prove useful. A particular domain where this kind of research would be invaluable is, as previously mentioned, molecular gastronomy: understanding phase changes and the properties of liquids, solids and gels can lead to the advancement of this (pseudo)-scientific discipline, with numerous applications in day-to-day life. Molecular gastronomy is an industry on the rise; perhaps in twenty or fifty years the classic Sunday roast will be replaced by a mixture of flavoured foams, gels and powders.&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687268</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687268"/>
		<updated>2018-03-13T23:38:29Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Food constitutes a huge part of our lives, whether we actively think about it or not. Cooking, even though not always as we know it today, has been around ever since the first human realised that fire makes raw meat tastier and more convenient to eat. Nowadays, the food industry is enormous and cooking has become a successful blend of art and science. Perhaps the most recent &amp;quot;trend&amp;quot; is molecular gastronomy: a subdiscipline of food science that seeks to investigate the physical and chemical transformations of ingredients during the cooking process. Balham et al. have published a review of the science behind molecular gastronomy in 2010.&amp;lt;ref&amp;gt;P. Barham, L. H. Skibsted, W. L. P. Bredie and J. Risbo, &#039;&#039;Symp.&lt;br /&gt;
A Q. J. Mod. Foreign Lit.&#039;&#039;, 2010, 2313–2365.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The term &amp;quot;science&amp;quot; may not be that far off, in fact, when refering to molecular gastronomy. The kitchen of such a &amp;quot;cook&amp;quot; looks more like a laboratory, populated with equipment such as butane burners, syringes and dehydrators. This discipline of gastronomy has led to outlandish dishes, from cocktails served as gellified spheres, to flavoured foams and powdered oils. The clever presentations and unusual sensations are piquing the interest of many people; in some places, molecular gastronomy restaurants have become tourist attractions.&amp;lt;ref&amp;gt;D. Tüzünkan and A. Albayrak, &#039;&#039;Procedia&lt;br /&gt;
- Soc. Behav. Sci.&#039;&#039;, 2015, &#039;&#039;&#039;195&#039;&#039;&#039;, 446–452.&amp;lt;/ref&amp;gt; Simulating the thermodynamic properties of systems can provide a better understanding of physical systems and can lead to the improvement and development of practices such as molecular gastronomy.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;P. Atkins, J. De Paula, &#039;&#039;Physical&lt;br /&gt;
Chemistry&#039;&#039;, OUP Oxford, 9th edn., 2009.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;O. J. Eder, &#039;&#039;J. Chem. Phys.&#039;&#039;, 1977, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866–3870.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
This lab provided insight into the thermodynamic properties of systems and how these change with phase, temperature, pressure. Of course, the systems investigated were small, but modeling larger, more complicated systems is possible and could prove useful. A particular domain where this kind of research would be invaluable is, as previously mentioned, molecular gastronomy: understanding phase changes and the properties of liquids, solids and gels can lead to the advancement of this (pseudo)-scientific discipline, with numerous applications in day-to-day life. Molecular gastronomy is an industry on the rise; perhaps in twenty or fifty years the classic Sunday roast will be replaced by a mixture of flavoured foams, gels and powders.&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687260</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687260"/>
		<updated>2018-03-13T23:30:47Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Food constitutes a huge part of our lives, whether we actively think about it or not. Cooking, even though not always as we know it today, has been around ever since the first human realised that fire makes raw meat tastier and more convenient to eat. Nowadays, the food industry is enormous and cooking has become a successful blend of art and science. Perhaps the most recent &amp;quot;trend&amp;quot; is molecular gastronomy: a subdiscipline of food science that seeks to investigate the physical and chemical transformations of ingredients during the cooking process. Balham et al. have published a review of the science behind molecular gastronomy in 2010.&amp;lt;ref&amp;gt;P. Barham, L. H. Skibsted, W. L. P. Bredie and J. Risbo, &#039;&#039;Symp.&lt;br /&gt;
A Q. J. Mod. Foreign Lit.&#039;&#039;, 2010, 2313–2365.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The term &amp;quot;science&amp;quot; may not be that far off, in fact, when refering to molecular gastronomy. The kitchen of such a &amp;quot;cook&amp;quot; looks more like a laboratory, populated with equipment such as butane burners, syringes and dehydrators. This discipline of gastronomy has led to outlandish dishes, from cocktails served as gellified spheres, to flavoured foams and powdered oils. The clever presentations and unusual sensations are piquing the interest of many people; in some places, molecular gastronomy restaurants have become tourist attractions.&amp;lt;ref&amp;gt;D. Tüzünkan and A. Albayrak, &#039;&#039;Procedia&lt;br /&gt;
- Soc. Behav. Sci.&#039;&#039;, 2015, &#039;&#039;&#039;195&#039;&#039;&#039;, 446–452.&amp;lt;/ref&amp;gt; Simulating the thermodynamic properties of systems can provide a better understanding of physical systems and can lead to the improvement and development of practices such as molecular gastronomy.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;P. Atkins, J. De Paula, &#039;&#039;Physical&lt;br /&gt;
Chemistry&#039;&#039;, OUP Oxford, 9th edn., 2009.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;O. J. Eder, &#039;&#039;J. Chem. Phys.&#039;&#039;, 1977, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866–3870.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687256</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687256"/>
		<updated>2018-03-13T23:29:30Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Food constitutes a huge part of our lives, whether we actively think about it or not. Cooking, even though not always as we know it today, has been around ever since the first human realised that fire makes raw meat tastier and more convenient to eat. Nowadays, the food industry is enormous and cooking has become a successful blend of art and science. Perhaps the most recent &amp;quot;trend&amp;quot; is molecular gastronomy: a subdiscipline of food science that seeks to investigate the physical and chemical transformations of ingredients during the cooking process. Balham et al. have published a review of the science behind molecular gastronomy in 2010.&amp;lt;ref&amp;gt;P. Barham, L. H. Skibsted, W. L. P. Bredie and J. Risbo, &#039;&#039;Symp.&lt;br /&gt;
A Q. J. Mod. Foreign Lit.&#039;&#039;, 2010, 2313–2365.&amp;lt;/ref&amp;gt; Indeed, the kitchen of a molecular gastronomist looks more like a lab, populated with equipment such as butane burners, syringes and dehydrators. This discipline of gastronomy has led to outlandish dishes, from cocktails served as gellified spheres, to flavoured foams and powdered oils. The clever presentations and unusual sensations are piquing the interest of many people; in some places, molecular gastronomy restaurants have become tourist attractions.&amp;lt;ref&amp;gt;D. Tüzünkan and A. Albayrak, &#039;&#039;Procedia&lt;br /&gt;
- Soc. Behav. Sci.&#039;&#039;, 2015, &#039;&#039;&#039;195&#039;&#039;&#039;, 446–452.&amp;lt;/ref&amp;gt; Simulating the thermodynamic properties of systems can provide a better understanding of physical systems and can lead to the improvement and development of practices such as molecular gastronomy.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;P. Atkins, J. De Paula, &#039;&#039;Physical&lt;br /&gt;
Chemistry&#039;&#039;, OUP Oxford, 9th edn., 2009.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;O. J. Eder, &#039;&#039;J. Chem. Phys.&#039;&#039;, 1977, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866–3870.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687253</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687253"/>
		<updated>2018-03-13T23:27:36Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Food constitutes a huge part of our lives, whether we actively think about it or not. Cooking, even though not always as we know it today, has been around ever since the first human realised that fire makes raw meat tastier and more convenient to eat. Nowadays, the food industry is enormous and cooking has become a successful blend of art and science. Perhaps the most recent &amp;quot;trend&amp;quot; is molecular gastronomy: a subdiscipline of food science that seeks to investigate the physical and chemical transformations of ingredients during the cooking process.&amp;lt;ref&amp;gt;P. Barham, L. H. Skibsted, W. L. P. Bredie and J. Risbo, &#039;&#039;Symp.&lt;br /&gt;
A Q. J. Mod. Foreign Lit.&#039;&#039;, 2010, 2313–2365.&amp;lt;/ref&amp;gt; Indeed, the kitchen of a molecular gastronomist looks more like a lab, populated with equipment such as butane burners, syringes and dehydrators. This discipline of gastronomy has led to outlandish dishes, from cocktails served as gellified spheres, to flavoured foams and powdered oils. The clever presentations and unusual sensations are piquing the interest of many people; in some places, molecular gastronomy restaurants have become tourist attractions.&amp;lt;ref&amp;gt;D. Tüzünkan and A. Albayrak, &#039;&#039;Procedia&lt;br /&gt;
- Soc. Behav. Sci.&#039;&#039;, 2015, &#039;&#039;&#039;195&#039;&#039;&#039;, 446–452.&amp;lt;/ref&amp;gt; Simulating the thermodynamic properties of systems can provide a better understanding of physical systems and can lead to the improvement and development of practices such as molecular gastronomy. &lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;P. Atkins, J. De Paula, &#039;&#039;Physical&lt;br /&gt;
Chemistry&#039;&#039;, OUP Oxford, 9th edn., 2009.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;O. J. Eder, &#039;&#039;J. Chem. Phys.&#039;&#039;, 1977, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866–3870.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687218</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687218"/>
		<updated>2018-03-13T23:02:37Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Anything that surrounds us, be it man-made or not, has a set of thermodynamic properties associated with it. These properties depend on external factors such as temperature and pressure and as such can be altered and tailored to suit whatever needs we have. A prime example of this is cooking: humans realised quickly that cooking meat (essentially denaturing the proteins found in meat) makes it tastier, easier to eat and, overall, more convenient. Nowadays, the food industry is enormous and cooking has become a successful blend of art and science. Perhaps the most recent &amp;quot;trend&amp;quot; is molecular gastronomy: a subdiscipline of food science that seeks to investigate the physical and chemical transformations of ingredients during the cooking process. Indeed, the kitchen of a molecular gastronomist looks more like a lab, populated with pieces of equipment such as butane burners, syringes and dehydrators. This discipline of gastronomy has led to outlandish dishes, from cocktails served as gellified spheres, to flavoured foams and powdered oils. The clever presentation and new sensations are piquing the interest of many people; molecular gastronomy restaurants have become tourist attractions and in some places have even led to the improvement of the local economy.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687185</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687185"/>
		<updated>2018-03-13T22:36:33Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Abstract */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Solid, liquid and gaseous systems were modeled using LAMMPS and a 12-6 Lennard-Jones forcefield. A suitable timestep of 0.0025 was determined. Simulations were run to obtain thermodynamic data (temperatures, pressures, densities, heat capacities). Calculated densities were found to be lower than those predicted by the ideal gas law. The simulated heat capacities showed a trend, decreasing with increasing temperature. The RDF was calculated for systems in all three phases. As expected, the RDF for a solid showed peaks decaying in amplitude. Lattice spacings and coordination numbers for the solid FCC lattice were calculated. The MSD and the VACF were plotted for the same three systems and the diffusion coefficient was calculated for both measurements. The two methods did not result in identical values; still, the difference was only 0.67% for the diffusion coefficients in the gas phase.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687173</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687173"/>
		<updated>2018-03-13T22:29:12Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Aims and Objectives */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
* become familiar with LAMMPS and how simulating a physical system works&lt;br /&gt;
* model the behaviour of systems under the 12-6 Lennard-Jones potential&lt;br /&gt;
* calculate the physical properties (temperature, pressure, density, etc) of a system using such simulations&lt;br /&gt;
* comparing the results of the simulations to theory (e.g. simulated density vs density given by the ideal gas law)&lt;br /&gt;
* calculating the diffusion coefficient for systems in different phases (gas, liquid, solid) by two different methods (from the MSD and from the VACF)&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687155</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687155"/>
		<updated>2018-03-13T22:23:29Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The Radial Distribution Function (RDF) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|right|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687154</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687154"/>
		<updated>2018-03-13T22:23:08Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The diffusion coefficient, D */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687152</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687152"/>
		<updated>2018-03-13T22:22:16Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The Radial Distribution Function (RDF) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687150</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687150"/>
		<updated>2018-03-13T22:21:54Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Heat capacities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|center|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687148</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687148"/>
		<updated>2018-03-13T22:21:00Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Densities and the ideal gas law */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|center|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687146</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687146"/>
		<updated>2018-03-13T22:20:28Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Heat capacities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation.&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687145</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687145"/>
		<updated>2018-03-13T22:19:59Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Heat capacities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation. Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687142</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687142"/>
		<updated>2018-03-13T22:19:15Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The Radial Distribution Function (RDF) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation. Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687141</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687141"/>
		<updated>2018-03-13T22:18:38Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Heat capacities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation. Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687140</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687140"/>
		<updated>2018-03-13T22:18:15Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Heat capacities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This agrees with the formula for heat capacity, which shows inverse proportionality to temperature. However, this is not the full extent of the explanation. Heat capacity is a measure of how much energy (heat) is required to increase the temperature of a system. At higher temperatures more energetic states become available and the spacing between them decreases - this makes populating higher states easier, leading to a decrease in heat capacity. In addition to this, increasing the temperature can lead to a phase change and thus to an increase in the degrees of freedom available to the system (e.g. melting causes a solid - rigid, fewer degrees of freedom - to change into a liquid).&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687075</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687075"/>
		<updated>2018-03-13T21:22:54Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Heat capacities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The variation in heat capacity with temperature is shown in Fig. 7. The system is under the NVE ensemble so we are dealing with the isochoric heat capacity, C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with increasing temperature. This seems to agree with the formula for heat capacity, as it shows inverse proportionality to temperature. However, this is not quite so simple. As the temperature increases more energetic states become available and can be populated, which would lead to an increase in the degrees of freedom&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687058</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687058"/>
		<updated>2018-03-13T21:12:28Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The diffusion coefficient (D) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient, D===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687056</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687056"/>
		<updated>2018-03-13T21:12:00Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internal energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687054</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687054"/>
		<updated>2018-03-13T21:11:43Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where E is the internal energy and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in internalenergy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687033</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687033"/>
		<updated>2018-03-13T20:39:57Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The diffusion coefficient (D) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0).&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
The harmonic oscillator shows perfectly oscillatory behaviour, with constant amplitude in time. This is because the system oscillates (as the name would suggest); the velocity becomes uncorrelated and then returns to its original state. &lt;br /&gt;
The solid shows similar behaviour: the VACF oscillates about 0 but dampens with time. &lt;br /&gt;
The gas VACF tends slowly to zero - so slowly, in fact, that by the end of this simulation it is nowhere close to it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687026</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=687026"/>
		<updated>2018-03-13T20:34:53Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The diffusion coefficient (D) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
&lt;br /&gt;
The VACF decreases slowly for a gas&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and thus the system will take longer to reach equilibrium (the linear region) than, say, a liquid. A longer simulation that would allow the system to reach equilibrium and then collect a larger amount of data would provide a more accurate result, as in this case the linear region that was used only comprised about 20% of the total data. In the case of a liquid, the MSD function is linear and provides the best fit and thus the most accurate result. The MSD for a solid establishes linear behaviour quickly, as the particles are &amp;quot;fixed&amp;quot;. The diffusion coefficient values are very small; this shows that in a solid no diffusion (or almost none) takes place.&lt;br /&gt;
&lt;br /&gt;
In the case of the VACF measurements the largest error comes from using the trapezium rule to compute the integral. The smaller the timestep, the more accurate the measurement - in this case the timestep is relatively small but some error still remains. &lt;br /&gt;
&lt;br /&gt;
The errors in both of these measurements cause the diffusion coefficients to differ slightly. The difference between the MSD- and VACF-calculated diffusion coefficients are 0.67%, 15.3% and 31780% for the gas, liquid and solid phases respectively. The difference in the case of the solid phase is incredibly large but not significant as we have established diffusion is not a significant process for solids. The difference for the liquid phase is quite small and likely comes from the poor fit of the MSD plot and the short duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686953</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686953"/>
		<updated>2018-03-13T19:54:11Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The diffusion coefficient (D) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
&lt;br /&gt;
The VACF decreases slowly for a gas&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The values decrease in the order gas &amp;gt; liquid &amp;gt; solid, which is to be expected. The diffusion coefficient values obtained for the solid are all very small (10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; or smaller); this is because particles in a solid are &amp;quot;fixed&amp;quot; and no diffusion (or almost none) can take place. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The largest error in the case of the MSD measurements comes from the fact that the gas phase gives rise to a curved plot, which cannot be feasibly fitted to a straight line. This is because particles in a gas will diffuse readily and&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686942</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686942"/>
		<updated>2018-03-13T19:46:31Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The diffusion coefficient (D) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
The VACF is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated. &lt;br /&gt;
&lt;br /&gt;
The VACF decreases slowly for a gas&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Diffusion coefficients &amp;lt;math&amp;gt; D / m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Phase&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | MSD data&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | VACF data&lt;br /&gt;
|- &lt;br /&gt;
! Small simulation &lt;br /&gt;
! Large simulation &lt;br /&gt;
! Small simulation&lt;br /&gt;
! Large simulation&lt;br /&gt;
|- &lt;br /&gt;
! Gas &lt;br /&gt;
| 2.536&lt;br /&gt;
| 2.542&lt;br /&gt;
| 3.294&lt;br /&gt;
| 3.268 &lt;br /&gt;
|- &lt;br /&gt;
! Gas, linear region &lt;br /&gt;
| 3.317&lt;br /&gt;
| 3.217&lt;br /&gt;
| ---&lt;br /&gt;
| ---&lt;br /&gt;
|- &lt;br /&gt;
! Liquid&lt;br /&gt;
| 0.085 &lt;br /&gt;
| 0.087 &lt;br /&gt;
| 0.098&lt;br /&gt;
| 0.090&lt;br /&gt;
|-  &lt;br /&gt;
! Solid&lt;br /&gt;
| 5.825 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.391 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.845 x 10^&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.558 x 10^&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ad5215TS&amp;diff=686921</id>
		<title>Rep:Mod:ad5215TS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ad5215TS&amp;diff=686921"/>
		<updated>2018-03-13T19:30:36Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Bond lengths */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The aim of this lab is to investigate three Diels-Alder reactions by considering primary and secondary orbital interactions and the effect these have on the overall energy of the molecules and the transition states.&lt;br /&gt;
A transition structure is the highest energy point on a reaction energy profile, while on a potential energy surface (PES) it appears as a saddle point. The first derivative of a saddle point is zero - however, the same is true for a minimum or a maximum. In order to establish a saddle point, the second derivative matrix (Hessian matrix) is needed. The Hessian matrix is related to the force constants of the TS vibrations. In the case of a saddle point the determinant of this matrix must be negative, which requires a negative force constant and therefore an imaginary vibration associated with it. A TS optimisation locates this saddle point  in 3N-6 dimensions (where N is the number of atoms in the molecule) using various methods (e.g. Hartree-Fock, Density Functional Theory, hybrids of these). An Intrinsic Reaction Coordinate (IRC) calculation can then be used to find the 1D reaction energy profile.&amp;lt;ref&amp;gt;Gaussian – Vibration Analysis in Gaussian, http://gaussian.com/vib, (accessed December 2017)&amp;lt;/ref&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
[[User:Nf710|Nf710]] ([[User talk:Nf710|talk]]) 10:49, 15 December 2017 (UTC) Using the determinant method is a way, but this will also be true if the is an odd number of negative eigenvalues. So you should use the eigenvalues of the hessian generally. A diagram of the PES would have made this paragram much easier to understand.&lt;br /&gt;
&lt;br /&gt;
The methods used in this lab for optimising to a minimum or a TS and for IRC calculations are PM6 and B3LYP. &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:hotpink&amp;quot;&amp;gt;PM6&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; is a semi-empirical method, i.e. a simplified version of the Hartree-Fock method.&amp;lt;ref&amp;gt;Gaussian – Semi-Empirical Methods, http://gaussian.com/semiempirical, (accessed December 2017)&amp;lt;/ref&amp;gt; &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:hotpink&amp;quot;&amp;gt;B3LYP&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; is a hybrid functional, meaning it employs both the DFT and Hartree-Fock methods. In this case, it was run using a 6-31G basis set.&amp;lt;ref&amp;gt;Gaussian – Density Functional (DFT) Methods, http://gaussian.com/dft, (accessed December 2017)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[User:Nf710|Nf710]] ([[User talk:Nf710|talk]]) 10:49, 15 December 2017 (UTC) You have shown some understanding but this is extremely brief.&lt;br /&gt;
&lt;br /&gt;
== Exercise 1: Diels-Alder reaction of butadiene and ethylene ==&lt;br /&gt;
&lt;br /&gt;
([[User:Fv611|Fv611]] ([[User talk:Fv611|talk]]) Very good, concise section. Your MO diagram is great. The only thing missing is an assessment of the significance of the measured lengths for the bonds being formed at the TS with respect to the VdW radius of carbon and to the length of an sp3 hybridised bond.)&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ex1 scheme v2.jpg]]&lt;br /&gt;
&amp;lt;br&amp;gt;Butadiene and ethene react in a [4+2] cycloaddition (a Diels-Alder reaction) to yield cyclohexene. In this particular reaction, the diene is more electron-rich than the dienophile, meaning it obeys normal electron demand.&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. Clayden, N. Greeves and S. Warren, &#039;&#039;Organic Chemistry&#039;&#039;, Oxford University Press, 2nd edn., 2012.&amp;lt;/ref&amp;gt;   &lt;br /&gt;
===Molecular Orbitals===&lt;br /&gt;
The MO diagram associated with this Diels-Alder reaction is below, followed by Jmol objects illustrating the MOs. The two non-bonding MOs of butadiene were left out to make the diagram more clear. One thing to note is that this diagram was constructed using the relative energies calculated by Gaussian for the MOs of the transition state and not of the products. This is why the resulting MOs are higher in energy than would be expected.&amp;lt;br&amp;gt; &lt;br /&gt;
[[File:Ad5215 ex1 modiagram final.jpg]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Butadiene&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;Butadiene - HOMO&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;aliceblue&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;Ad5215 butadiene ex1.LOG&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 60; mo 11; mo nodots nomesh fill translucent; mo titleformat; &amp;quot;&amp;quot;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;Butadiene - LUMO&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;aliceblue&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;Ad5215 butadiene ex1.LOG&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 60; mo 12; mo nodots nomesh fill translucent; mo titleformat; &amp;quot;&amp;quot;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ethene&amp;lt;/b&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;Ethene - HOMO&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;LavenderBlush&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;ad5215_ethene_ex1.log&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 2; mo 6; mo nodots nomesh fill translucent; mo titleformat; &amp;quot;&amp;quot;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;Ethene - LUMO&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;LavenderBlush&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;ad5215_ethene_ex1.log&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 2; mo 7; mo nodots nomesh fill translucent; mo titleformat; &amp;quot;&amp;quot;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Diels-Alder Transition State&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;MO 16&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;Lavender&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;ad5215_ex1_ts.LOG&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 18; mo 16; mo nodots nomesh fill translucent; mo titleformat; &amp;quot;&amp;quot;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt; &lt;br /&gt;
| &lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;Transition state - HOMO&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;Lavender&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;ad5215_ex1_ts.LOG&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 18; mo 17; mo nodots nomesh fill translucent; mo titleformat; &amp;quot;&amp;quot;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt; &lt;br /&gt;
| &lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;Transition state - LUMO&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;Lavender&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;ad5215_ex1_ts.LOG&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 18; mo 18; mo nodots nomesh fill translucent; mo titleformat; &amp;quot;&amp;quot;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt; &lt;br /&gt;
| &lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;MO 19&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;Lavender&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;ad5215_ex1_ts.LOG&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 18; mo 19; mo nodots nomesh fill translucent; mo titleformat; &amp;quot;&amp;quot;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order for orbitals to have a favourable interaction, i.e. one that results in overall stabilisation of the molecule, the overlap integral associated with that interaction must be non-zero. Since this integral is proportional to the spatial overlap of the orbitals, these must have the &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:hotpink&amp;quot;&amp;gt;same symmetry&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; — both symmetric (S) or both antisymmetric (AS). This results in an overall symmetric function, with a non-zero overlap. Combining orbitals of opposing symmetries (i.e. an AS and an S) leads to an &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:hotpink&amp;quot;&amp;gt;antisymmetric&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; function and to a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:hotpink&amp;quot;&amp;gt;zero overlap integral&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&amp;lt;ref&amp;gt;P. Atkins, T. Overton, J. Rourke, M. Weller and F. Armstrong, &#039;&#039;Shriver &amp;amp; Atkins’ Inorganic Chemistry&#039;&#039;, Oxford University Press, 5th edn., 2010.&amp;lt;/ref&amp;gt; &lt;br /&gt;
===Bond lengths===&lt;br /&gt;
&lt;br /&gt;
This reaction is a [4+2] cycloaddition (specifically a Diels—Alder reaction). It proceeds via a cyclic transition state and it involves the breaking of three C-C double bonds and the formation of two single bonds and a new double bond.&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; The lengths of these bonds are expected to change accordingly during the course of the reaction. &lt;br /&gt;
&lt;br /&gt;
Average C-C bond lengths are 1.530 Å for an sp&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;-sp&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; single bond, 1.507 Å for an sp&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;-sp&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; single bond, 1.460 Å for an sp&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;-sp&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; single bond and 1.316 Å for an sp&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;-sp&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; double bond.&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;A. G. Orpen, L. Brammer, F. H. Allen, O. Kennard, D. G. Watson and R. Taylor, &#039;&#039;J. Chem. Soc. Dalt. Trans.&#039;&#039;, 1987, S1–S83.&amp;lt;/ref&amp;gt;  The van der Waals radius of a carbon atom is 1.70 Å.&amp;lt;ref&amp;gt;F. A. Carey and R. J. Sundberg, &#039;&#039;Advanced Organic Chemistry Part A: Structure and Mechanisms&#039;&#039;, 2007.&amp;lt;/ref&amp;gt; The bond lengths present in the reactants / products during the course of the reaction are in Table 1, below. They differ from the literature values by roughly 0.01 Å. However, literature values for C-C bond lengths in cyclohexene are almost identical to the calculated ones: 1.541 Å for an sp&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;-sp&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; single bond, 1.506 Å for an sp&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;-sp&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; single bond, and 1.326 for an sp&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;-sp&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; double bond.&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt; The double bond is, in fact, longer in the optimised product than in the literature example - this could be due to the fact that the product was optimised at the PM6 level. Using a more accurate method could result in a value more closely matched to literature. &lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Length of C-C bonds during the Diels-Alder reaction&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Bond&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Bond length / Å&lt;br /&gt;
|- &lt;br /&gt;
! Reactants &lt;br /&gt;
! Transition state &lt;br /&gt;
! Products&lt;br /&gt;
|- &lt;br /&gt;
! Bond 1 &lt;br /&gt;
| 1.335 &lt;br /&gt;
| 1.380 &lt;br /&gt;
| 1.501&lt;br /&gt;
|- &lt;br /&gt;
! Bond 2&lt;br /&gt;
| 1.468 &lt;br /&gt;
| 1.411 &lt;br /&gt;
| 1.338&lt;br /&gt;
|-  &lt;br /&gt;
! Bond 3&lt;br /&gt;
| 1.335 &lt;br /&gt;
| 1.380 &lt;br /&gt;
| 1.501&lt;br /&gt;
|- &lt;br /&gt;
! Bond 4 &lt;br /&gt;
| 3.415 &lt;br /&gt;
| 2.115 &lt;br /&gt;
| 1.540&lt;br /&gt;
|- &lt;br /&gt;
! Bond 5 &lt;br /&gt;
| 1.327 &lt;br /&gt;
| 1.382 &lt;br /&gt;
| 1.541&lt;br /&gt;
|- &lt;br /&gt;
! Bond 6 &lt;br /&gt;
| 3.414 &lt;br /&gt;
| 2.115 &lt;br /&gt;
| 1.540&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bonds 4 and 6 form during the reaction, so they &amp;quot;shorten&amp;quot; (it can be assumed that the reactants are infinitely apart to begin with, so the initial bond length is infinite. In the calculation, the reactants are brought closer together in order for the reaction to happen, so the initial bond length is less than infinity, but still considerably larger than the final length). Bond 2 changes from a single bond to a double bond and will therefore shorten as well. It should be noted that the pi-system in butadiene is conjugated. Therefore this bond has some double bond character and is shorter than the average C-C single bond. Bonds 1, 3 and 5 are all double bonds in the reactants and single bonds in the product, so they will become longer (1 and 3 are identical in this case and the plots overlap).     &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ad5215 ex1 bl col.jpg]] [[File:Ad5215 ex1mcl.jpg]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The vibration corresponding to the formation of the transition state (and the formation of the new bonds) is below. The two bonds are shown to form at the same time, which agrees with the fact that a Diels-Alder reaction proceeds via a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:hotpink&amp;quot;&amp;gt;concerted&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; mechanism (i.e. synchronous breaking and forming of bonds).&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ad5215 ex1 davibe.gif]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color:hotpink&amp;quot;&amp;gt;Relevant files&amp;lt;/span&amp;gt;===&lt;br /&gt;
Optimised product (PM6): [[File:Ad5215 ex1 PDT OPT.LOG]]&lt;br /&gt;
&lt;br /&gt;
Diels-Alder IRC: [[File:Ad5215 ex1 IRC.LOG]]&lt;br /&gt;
&lt;br /&gt;
== Exercise 2: Reaction of Cyclohexadiene and 1,3-Dioxole ==&lt;br /&gt;
[[File:Ad5215 ex2 scheme.jpg]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Cyclohexadiene and 1,3-dioxole can undergo a [4+2] cycloaddition. Because the double bond in the dienophile (i.e. the dioxole) is substituted, the reaction can yield two different products, depending on the orientation of the molecules when approaching each other. The exo product is formed when the substituents of the dienophile are pointing away from the pi system in the diene, while the endo is formed when the dienophile has the opposite orientation.&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
===Molecular Orbitals===&lt;br /&gt;
&lt;br /&gt;
([[User:Fv611|Fv611]] ([[User talk:Fv611|talk]]) The MO diagram is overall good, but the dienophile LUMO is a bit lower in energy than what I would have expected for an inverse electron demand reaction. You also should have discussed the difference between the endo and exo MO relative energies. As a rule of thumb, if you are not drawing the full molecules on your MO diagram, you need to specify which one is the diene and which one the dienophile.)&lt;br /&gt;
&lt;br /&gt;
The MO diagram for this reaction is below, as well as Jmol objects of the transition state MOs for both the endo and exo products. Due to the electron-donating oxygen atoms which make the dienophile more electron rich, this Diels-Alder reaction obeys &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:hotpink&amp;quot;&amp;gt;inverse electron demand.&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:hotpink&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;As with exercise 1, the MO energies are those corresponding to the transition state (calculated by running an IRC, followed by an Energy calculation in Gaussian). The reactants, products and transition states were optimised at the B3LYP level while the IRCs were run at the PM6 level.     &lt;br /&gt;
&lt;br /&gt;
10:58, 15 December 2017 (UTC) You can see this qualitatively if you look at the MOs of the diagram But if you looks at the MOs of the reactants on the same PES you can also see it qualitatively. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ad5215 ex2 modiagram.jpg]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Endo TS&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;ENDO (HOMO-1)&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;ivory&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;ad5215_ex2_ENDO_BLYP.LOG&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 42; mo 40; mo nodots nomesh fill translucent; mo titleformat; set antialiasdisplay on; mo cutoff 0.01&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;ENDO (HOMO)&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;ivory&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;ad5215_ex2_ENDO_BLYP.LOG&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 42; mo 41; mo nodots nomesh fill translucent; mo titleformat; set antialiasdisplay on; mo cutoff 0.01&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;ENDO (LUMO)&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;ivory&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;ad5215_ex2_ENDO_BLYP.LOG&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 42; mo 42; mo nodots nomesh fill translucent; mo titleformat; set antialiasdisplay on; mo cutoff 0.01&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;ENDO (LUMO+1)&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;ivory&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;ad5215_ex2_ENDO_BLYP.LOG&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 42; mo 43; mo nodots nomesh fill translucent; mo titleformat; set antialiasdisplay on; mo cutoff 0.01&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Exo TS&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;EXO (HOMO-1)&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;ivory&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;ad5215_ex2_EXO_BLYP.LOG&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 20; mo 40; mo nodots nomesh fill translucent; mo titleformat; set antialiasdisplay on; mo cutoff 0.01&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;EXO (HOMO)&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;ivory&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;ad5215_ex2_EXO_BLYP.LOG&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 20; mo 41; mo nodots nomesh fill translucent; mo titleformat; set antialiasdisplay on; mo cutoff 0.01&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;EXO (LUMO)&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;ivory&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;ad5215_ex2_EXO_BLYP.LOG&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 20; mo 42; mo nodots nomesh fill translucent; mo titleformat; set antialiasdisplay on; mo cutoff 0.01&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
&amp;lt;jmol&amp;gt;&amp;lt;jmolApplet&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;EXO (LUMO+1)&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;color&amp;gt;ivory&amp;lt;/color&amp;gt;&lt;br /&gt;
  &amp;lt;size&amp;gt;300&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;uploadedFileContents&amp;gt;ad5215_ex2_EXO_BLYP.LOG&amp;lt;/uploadedFileContents&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt; frame 20; mo 43; mo nodots nomesh fill translucent; mo titleformat; set antialiasdisplay on; mo cutoff 0.01&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/jmolApplet&amp;gt;&amp;lt;/jmol&amp;gt; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Energies===&lt;br /&gt;
[[File:Ad5215 endo exo soo.jpg|thumb|right|Secondary orbital overlap stabilises the endo transition state.]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 2: Energies associated with the reaction between cyclohexadiene and 1,3-dioxole.&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Product type&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Reaction barrier&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Reaction energy &lt;br /&gt;
|- &lt;br /&gt;
| Hartrees/particle&lt;br /&gt;
|kJ/mol&lt;br /&gt;
|Hartrees/particle&lt;br /&gt;
|kJ/mol&lt;br /&gt;
|- &lt;br /&gt;
! Endo&lt;br /&gt;
| 0.058218&lt;br /&gt;
| 152.85133794&lt;br /&gt;
| -0.027385&lt;br /&gt;
| -71.89930759&lt;br /&gt;
|-  &lt;br /&gt;
! Exo&lt;br /&gt;
| 0.061152&lt;br /&gt;
| 160.55455388&lt;br /&gt;
| -0.026056&lt;br /&gt;
| -68.41001858&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:hotpink&amp;quot;&amp;gt; energy barrier &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; refers to the difference in energy between the reactants and the transition state. Essentially, it is the energy needed for the reaction to happen. It can be seen from the table above that this barrier is greater in the case of the exo transition state. This means that the endo product is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:hotpink&amp;quot;&amp;gt; kinetically &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; preferred, as it will overcome this energy requirement more easily and be formed faster. This is because in the case of the endo product the transition state is stabilised by favourable interactions between the oxygen atoms in the 1,3-dioxole and the π-system of the cyclohexadiene. This secondary orbital overlap is shown on the right and is also visible in the Jmol images above.&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; &lt;br /&gt;
[[File:Ad5215 ch2 frag.jpg|thumb|right|Position of CH&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; fragment in exo and endo products.]]  &lt;br /&gt;
The endo product is also the &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:hotpink&amp;quot;&amp;gt; thermodynamically &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; preferred product - the free energy difference (between products and reactants) associated with the reaction is smaller (more negative) for the endo product. In the exo product the five-membered ring is oriented in a way that results in steric clash between the CH&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; fragment (coloured in red in the figure) and the carbon &amp;quot;bridge&amp;quot;. This interaction is not as significant in the endo product, since the CH&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; fragment is farther away. Therefore, the endo product will be lower in energy than the exo.    &lt;br /&gt;
 &lt;br /&gt;
This is in accordance with the &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:hotpink&amp;quot;&amp;gt;endo rule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;, which states that in [4+2] cycloadditions the endo product is preferred due to the favourable secondary orbital overlap which stabilises the transition state (meaning the endo product is favoured kinetically). This is true even if the exo product is thermodynamically more stable.&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color:hotpink&amp;quot;&amp;gt;Relevant files&amp;lt;/span&amp;gt;===&lt;br /&gt;
Cyclohexadiene (B3LYP): [[File:Ad5215 CYCLOHEXADIENE B3LYP.LOG]]&lt;br /&gt;
&lt;br /&gt;
1,3-Dioxole (B3LYP): [[File:Ad5215 13 DIOX BLYP.LOG]]&lt;br /&gt;
&lt;br /&gt;
Endo product (B3LYP): [[File:Ad5215 ENDO PRODUCT B3LYP.LOG]]&lt;br /&gt;
&lt;br /&gt;
Exo product (B3LYP): [[File:Ad5215 EX2 EXO PDT B3LYP.LOG]]&lt;br /&gt;
&lt;br /&gt;
Endo IRC (PM6): [[File:Ad5215 ex2 ENDO IRC.LOG]]&lt;br /&gt;
&lt;br /&gt;
Exo IRC (PM6): [[File:Ad5215 ex2 EXO IRC.LOG]]&lt;br /&gt;
&lt;br /&gt;
[[User:Nf710|Nf710]] ([[User talk:Nf710|talk]]) 11:01, 15 December 2017 (UTC) This was a good section. You could have talked abit more about the electron demand of the reaction. Your energies are slightly not correct but you have come to the correct conclusions and you have used diagrams to explain them which is good. Your intro could have gone into more depth.&lt;br /&gt;
&lt;br /&gt;
== Exercise 3: Reaction between o-xylylene and SO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; ==&lt;br /&gt;
[[File:Ad5215 ex3 scheme.jpg]]&lt;br /&gt;
&lt;br /&gt;
o-Xylylene and sulfur dioxide can react in multiple ways. The two conjugated double bonds on the 6-membered ring act in a similar way to butadiene. Therefore, the two molecules can either undergo a [4+2] cycloaddition, resulting in two Diels-Alder products (endo and exo) or can react in a cheletropic manner, forming a 5-membered heterocycle. &lt;br /&gt;
IRC calculations were run for all three possible outcomes of the reaction (Diels-Alder, endo and exo, and cheletropic). These are reproduced below as .gif files.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
! Endo&lt;br /&gt;
! Exo&lt;br /&gt;
! Cheletropic&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Ad5215 da endo irc.gif]]&lt;br /&gt;
| [[File:Ad5215 exo rev.gif]]&lt;br /&gt;
| [[File:Ad5215 chel irc.gif]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The free energies calculated by Gaussian were tabulated (using the reactants/products/transition states optimised at the PM6 level). Activation energies and free energy changes were calculated for each reaction and energy profiles were plotted using Python and Jupyter.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 3: Energies associated with the reactions between o-xylylene and SO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; (at the &amp;quot;endocyclic&amp;quot; diene site). &lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Product type&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Reaction barrier&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Reaction energy &lt;br /&gt;
|- &lt;br /&gt;
| Hartrees/particle&lt;br /&gt;
|kJ/mol&lt;br /&gt;
|Hartrees/particle&lt;br /&gt;
|kJ/mol&lt;br /&gt;
|- &lt;br /&gt;
! Endo&lt;br /&gt;
| 0.031742&lt;br /&gt;
| 83.33860952&lt;br /&gt;
| -0.037124&lt;br /&gt;
| -97.46904857&lt;br /&gt;
|-  &lt;br /&gt;
! Exo&lt;br /&gt;
| 0.033259&lt;br /&gt;
| 87.32149247&lt;br /&gt;
| -0.037365&lt;br /&gt;
| -98.10179398&lt;br /&gt;
|-  &lt;br /&gt;
! Cheletropic&lt;br /&gt;
| 0.040243&lt;br /&gt;
| 105.65798194&lt;br /&gt;
| -0.058821&lt;br /&gt;
| -154.43451422&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Based on the thermodynamic calculations above, the endo Diels-Alder product is the kinetically preferred product (smallest activation energy), with the exo Diels-Alder having a slightly higher barrier. The cheletropic product has a much larger activation energy, but is much more stable - this is the thermodynamic product. The free energy change corresponding to the cheletropic reaction is almost 60 kJ/mol greater than for the Diels-Alder reaction. This is summed up in the graph below, which shows the reaction energy profile for the formation of both Diels-Alder products, as well as for the cheletropic reaction. These reactions are all favourable from a thermodynamic point of view, which can be explained by the fact that the end product in all cases is an aromatic molecule, essentially a substituted benzene ring. Aromatic stabilisation is larger than stabilisation given purely by conjugation of double bonds, which leads to a lower energy of the molecule.&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;&lt;br /&gt;
[[File:Ad5215 ex1 energy profile.svg|center|700px|Energy profile for the reaction between o-xylylene and SO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
(Normalising the reactants to 0 would allow easier comparison and faster visualisation of barriers and reaction energies. Otherwise, nice plot. Python &amp;gt; Excel [[User:Tam10|Tam10]] ([[User talk:Tam10|talk]]) 14:46, 7 December 2017 (UTC))&lt;br /&gt;
&lt;br /&gt;
The o-xylylene molecule has another site which can act as a diene in a Diels-Alder reaction. The &amp;quot;exocyclic&amp;quot; reaction site is the one that was previously considered in all the calculations and involves the double bonds outside the 6-membered ring. The &amp;quot;endocyclic&amp;quot; site is the cyclohexadiene fragment present in the molecule. The endo and exo products and transition states for reactions at the &amp;quot;endocyclic&amp;quot; site were optimised and the energies tabulated. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 4: Energies associated with the Diels-Alder reaction between o-xylylene and SO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; (at the &amp;quot;exocyclic&amp;quot; diene site). &lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Product type&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Reaction barrier&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Reaction energy &lt;br /&gt;
|- &lt;br /&gt;
| Hartrees/particle&lt;br /&gt;
|kJ/mol&lt;br /&gt;
|Hartrees/particle&lt;br /&gt;
|kJ/mol&lt;br /&gt;
|- &lt;br /&gt;
! Endo&lt;br /&gt;
| 0.043252&lt;br /&gt;
| 113.55811036&lt;br /&gt;
| 0.006793&lt;br /&gt;
| 17.83501904&lt;br /&gt;
|-  &lt;br /&gt;
! Exo&lt;br /&gt;
| 0.046236&lt;br /&gt;
| 121.39260128&lt;br /&gt;
| 0.008486&lt;br /&gt;
| 22.27998993&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot below shows these reactions profiles and allows for them to be compared with the reactions at the &amp;quot;exocyclic&amp;quot; site. It can be seen that reactions at this site are less favourable, both thermodynamically (the products are higher in energy) and kinetically (the transition states are highest in energy and therefore the activation barriers are the greatest). &lt;br /&gt;
[[File:Ad5215 enpf f.svg|center|700px|Energy profile for the reaction between o-xylylene and SO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; at both diene sites.]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color:hotpink&amp;quot;&amp;gt;Relevant files&amp;lt;/span&amp;gt;===&lt;br /&gt;
Xylylene: [[File:Ad5215 ex3 XYLYLENE pm6.LOG]]&lt;br /&gt;
&lt;br /&gt;
SO2: [[File:Ad5215 ex3 SO2 pm6.LOG]]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Exocyclic&amp;quot; DA endo TS: [[File:Ad5215 ex3 DA ENDO TS PM6.LOG]]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Exocyclic&amp;quot; DA endo IRC: [[File:Ad5215 ex3 DA ENDO IRC.LOG]]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Exocyclic&amp;quot; DA endo product: [[File:Ad5215 ex3 Pdt endo min.LOG]]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Exocyclic&amp;quot; DA exo TS: [[File:Ad5215 DA EXO TS PM6.LOG]]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Exocyclic&amp;quot; DA exo IRC: [[File:Ad5215 ex3 DA EXO IRC.LOG]]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Exocyclic&amp;quot; DA exo product: [[File:Ad5215 ex3 PRODUCT EXO PM6.LOG]]&lt;br /&gt;
&lt;br /&gt;
Cheletropic TS: [[File:Ad5215 CHEL TS PM6.LOG]]&lt;br /&gt;
&lt;br /&gt;
Cheletropic IRC: [[File:Ad5215 ex3 chele IRC.LOG]]&lt;br /&gt;
&lt;br /&gt;
Cheletropic product: [[File:Ad5215 ex3 chele PRODUCT MIN.LOG]]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Endocylic&amp;quot; DA endo TS: [[File:Ad5215 extra ENDO TS.LOG]]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Endocylic&amp;quot; DA endo product: [[File:Ad5215 ex3 extra PM6 PDT endo.LOG]]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Endocylic&amp;quot; DA exo TS: [[File:Ad5215 ex3 extra EXO TS.LOG]]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Endocylic&amp;quot; DA exo IRC: [[File:Ad5215 ex3 extra EXO IRC.LOG]]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Endocylic&amp;quot; DA exo product: [[File:Ad5215 ex3 extra EXO PDT PM6.LOG]]&lt;br /&gt;
&lt;br /&gt;
All optimised at the PM6 level.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
The results obtained in this lab agree with pre-existing theory (in this case, the endo rule). While they require some knowledge of the reactants or products and in some cases of the transition state, computational methods prove to be a useful and welcome addition to more traditional chemical procedures, allowing for a detailed and (if using an appropriate method and basis set) accurate analysis of reaction parameters (such as energies and pathways) as well as visualisation of molecular orbitals. In the case of o-xylylene, for example, it was possible to model and analyse three different reactions and determine their outcome, while in practice this would be much more difficult, as this substrate is highly unstable in the solid or liquid phases.&amp;lt;ref&amp;gt;R. D. Miller, J. Kolc and J. Michl, &#039;&#039;J. Am. Chem. Soc.&#039;&#039;, 1976, &#039;&#039;&#039;98&#039;&#039;&#039;, 8510–8514.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Computational chemistry could be used to predict the outcome of reactions before attempting these in practice, therefore reducing the cost and time spent. It can also be used in conjunction with &amp;quot;classical&amp;quot; chemical methods to improve understanding of reaction mechanisms and pathways.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686786</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686786"/>
		<updated>2018-03-13T18:02:20Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The diffusion coefficient (D) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated in two different ways, either from the gradient of an MSD plot or from the integral of the VACF. These calculations were performed and the D values are given in Table 1.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686756</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686756"/>
		<updated>2018-03-13T17:55:08Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Appendix C: VACF running integral plots */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686752</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686752"/>
		<updated>2018-03-13T17:54:46Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The diffusion coefficient (D) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix C: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686749</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686749"/>
		<updated>2018-03-13T17:54:28Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Appendix A: MSD plots */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Appendix C: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686747</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686747"/>
		<updated>2018-03-13T17:54:06Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The diffusion coefficient (D) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the time evolution of the VACF for a solid, a liquid and a gas, as well as for an ideal harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Appendix C: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686736</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686736"/>
		<updated>2018-03-13T17:52:05Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The diffusion coefficient (D) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the VACFs for a solid, a liquid and a gas, as well as the VACF for an ideal harmonic oscillator, as functions of timestep. &lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Appendix C: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686735</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686735"/>
		<updated>2018-03-13T17:51:38Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The diffusion coefficient (D) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the VACFs for a solid, a liquid and a gas, as well as the VACF for an ideal harmonic oscillator. &lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png|frame|center|Fig. 10: VACF plots for small scale simulations]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Appendix C: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686731</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686731"/>
		<updated>2018-03-13T17:50:58Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Appendix A: MSD plots */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the VACFs for a solid, a liquid and a gas, as well as the VACF for an ideal harmonic oscillator. &lt;br /&gt;
[[&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Appendix C: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686729</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686729"/>
		<updated>2018-03-13T17:50:33Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The diffusion coefficient (D) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix B.&lt;br /&gt;
&lt;br /&gt;
Figure 10 below shows the VACFs for a solid, a liquid and a gas, as well as the VACF for an ideal harmonic oscillator. &lt;br /&gt;
[[&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Appendix C: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686723</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686723"/>
		<updated>2018-03-13T17:48:24Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Results &amp;amp; Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix C.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Appendix C: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686719</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686719"/>
		<updated>2018-03-13T17:47:51Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The diffusion coefficient (D) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B. Plots of the VACF running integral vs time are reproduced in Appendix C.&lt;br /&gt;
&lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686715</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686715"/>
		<updated>2018-03-13T17:47:07Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. The data was analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. The same data analysis was conducted using supplied data which modeled larger systems.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B.   &lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686707</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686707"/>
		<updated>2018-03-13T17:45:17Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* The diffusion coefficient (D) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. &lt;br /&gt;
The data was then analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total mean squared displacement vs time are reproduced in Appendix A. Plots of the VACF vs time are reproduced in Appendix B.   &lt;br /&gt;
===Appendix A: MSD plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Appendix B: VACF running integral plots===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686695</id>
		<title>Rep:AD5215LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:AD5215LS&amp;diff=686695"/>
		<updated>2018-03-13T17:39:08Z</updated>

		<summary type="html">&lt;p&gt;Ad5215: /* Section 7: Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Tasks=&lt;br /&gt;
==Section 2: Introduction==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Excel file attached [[:File:AD5215_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in energy goes down as the timestep value becomes smaller. For a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.25 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.58% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; while for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.05 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; the change in energy is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.06% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. The energy change is &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 1.01% &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; for a timestep of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt; 0.2 &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. A timestep that is too large could lead to the simulation effectively &amp;quot;missing&amp;quot; any changes in the system that happen on a shorter timescale than that of the timestep. Therefore, it is important to monitor the energy to ensure that the change is not too drastic and we are observing the behaviour of the system closely. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Find the separation at which the potential energy is zero&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj zero pot.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;FInd the force at &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The force is the derivative of potential wrt to distance:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj Force.JPG]]&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt; this will be&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 force(R).JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Equilibrium separation and well depth&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation when &amp;lt;math&amp;gt; \frac{d \phi}{dr} = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj equilibrium req.JPG]]&lt;br /&gt;
&lt;br /&gt;
The well depth at this separation is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ls lj epsilon.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Integrals&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 lj int1.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int2.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 int3.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = 1\ mL, \ \rho = 1\ g/mL, \ M = 18\ g/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m = V \rho = 1\ g&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N = nN_a = \frac{m}{M} \times N_a = \frac{6.022 \times 10^{23}}{18} = 3.35 \times 10{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
N molecules occupy 1 mL. Therefore, the volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1 molecule&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; of water will be &amp;lt;math&amp;gt;V_0 = \frac{1}{N} = \frac{1}{3.35 \times 10{22}} = 2.99 \times10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;1000 molecules&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; will be &amp;lt;math&amp;gt;1000 \times V_0 = 2.99 \times10^{-20} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It ends up at position &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#D80B60&amp;quot;&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = \sigma \times r^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 0.34 \times 3.2 = 1.088\ nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B &amp;lt;/math&amp;gt; for 1 particle&lt;br /&gt;
&lt;br /&gt;
For a mole of particles: &amp;lt;math&amp;gt;\epsilon = 120 \times k_B \times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 0.997\, kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 1.5 \times 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Randomly generated positions can lead to two atoms being very close together, which would result in a large repulsive potential. This would then affect any propagation in time of the system, which would lead to undesirable behaviour, especially when using larger timesteps. The system would most likely behave &amp;quot;appropriately&amp;quot; for small enough timesteps, but this would require running longer simulations. This would be less effective; a larger timestep that still results in an accurate simulation is ideal. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density: &amp;lt;math&amp;gt; \rho = \frac{N}{V} = \frac{N}{l^3} &amp;lt;/math&amp;gt; ---&amp;gt; Length: &amp;lt;math&amp;gt; l=\sqrt[3]{\frac{N}{\rho}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;simple cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 0.8 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{1}{0.8}}=1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt;face-centered cubic lattice&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; with &amp;lt;math&amp;gt; \rho = 1.2 &amp;lt;/math&amp;gt;, the length, l, is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}=1.4938 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The box would still contain &amp;lt;math&amp;gt; 10 \times 10 \times 10 = 1000 &amp;lt;/math&amp;gt; lattice units. For an FCC there are 4 atoms per lattice unit. Therefore the total number of atoms would be &amp;lt;math&amp;gt; 4 \times 1000 = 4000 &amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Mass&amp;quot; sets the mass of a particular type of atom (in this case, the mass of type 1 atoms is 1). &amp;quot;Pair&amp;quot; refers to pair potentials. The lj/cut command computes the 12/6 Lennard-Jones potential, cut sets the cut-off for r. Pair_coeff sets the values for the 2 parameters, sigma and epsilon. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:darkmagenta&amp;quot;&amp;gt; Velocity Verlet. &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; A simple Verlet algorithm wouldn&#039;t require the initial velocity, but would instead require &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &amp;quot;variable timestep equal 0.001&amp;quot; defines a variable timestep which is the assigned a value. This allows for the variable to be called later on if needed. This is convenient for the user as it means that if the same variable is required multiple times (in this case, the variable timestep is called twice) changing its value is easier, as this only needs to be done once (in the line defining the variable).&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 ljls gamma.JPG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the manual, the structure of the command is &amp;quot;ave/time Nevery Nrepeat Nfreq&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nevery (100) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = use input values every this many timesteps (total no. of data points is 100,000 so this will give 1000 values to be averaged in the next step; records an average of 100 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nrepeat (1000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = no. of times to use input values for calculating averages (i.e. average over 1000 values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt; Nfreq (100,000) &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt; = calculate averages every this many timesteps (same no. specified in the &amp;quot;run&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation runs for 100,000 steps. Therefore we are simulating a total time of &amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:#E807AF&amp;quot;&amp;gt;250 seconds &amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a HO model:&lt;br /&gt;
[[File:Ad5215 Vacf HO model.JPG]]&lt;br /&gt;
&lt;br /&gt;
The VACF is given by&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 VACF deriv.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the two integrals separately. Integral 2 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf cos(2x).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i2 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
Integral 1 is&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Using [[File:Ad5215 Vacf sin(A+B).JPG]] we can write&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 2.JPG]]&lt;br /&gt;
&lt;br /&gt;
We evaluate the last integral separately.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting this back we obtain:&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf i1 3.JPG]]&lt;br /&gt;
&lt;br /&gt;
Substituting I1 and I2 into the formula for C we obtain&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c1.JPG]]&lt;br /&gt;
&lt;br /&gt;
Sin is an odd function, i.e. [[File:Ad5215 Vacf sinodd.JPG]]. Thus&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Vacf c2.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Report=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&#039;&#039;&#039;General methods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A 12-6 Lennard-Jones system was modeled usings LAMMPS and all simulations were run using Imperial&#039;s High Performance Computer. &lt;br /&gt;
The potential for such a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All calculations used reduced units:&amp;lt;math&amp;gt;r^* = r/{\sigma}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E^* = E/{\epsilon}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = {k_BT}/{\epsilon}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The Lennard-Jones parameters &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; were set to 1.0 for all simulations. The cutoff for Lennard-Jones interactions was set at r*=3 unless otherwise stated. The mass of the atoms was set to 1.0. The temperature, pressure, lattice density and timestep values were varied. For all calculations the velocity Verlet algorithm was employed. The atoms were assigned random velocities within the simulation, while ensuring that the Boltzmann distribution of states is followed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Determining a suitable timestep&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 1000 atoms (10 x 10 x 10 dimensions). The ensemble was defined as the microcanonical (NVE) ensemble. Five values for the timestep were tested: 0.015, 0.01, 0.0075, 0.0025, 0.001 and each simulation was run for a total time of 100 seconds. Values for the energy, temperature and pressure of the system were recorded at each step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Variation of density with temperature and pressure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.8 was defined and the simulation was populated with 3375 atoms (15 x 15 x 15 dimensions). The timestep for all simulations was set to 0.0025. The ensemble was defined as NPT and 10 different thermodynamic states were simulated (two pressures, 2.5 and 3.5, each associated with five temperatures: 3.0, 6.0, 9.0, 12.0 and 15.0). Values for the energy, temperature and pressure of the system were recorded at each step, as well as average values for the density, temperature and pressure of the system at the end of the simulation. Plots of density vs time were obtained, both for the simulated data and for densities predicted by the ideal gas law, &amp;lt;math&amp;gt; PM = \rho RT.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat capacity calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice with a density of 0.2 was defined and populated with 3375 atoms. The timestep for all simulations was set to 0.0025. An NVT ensemble was simulated for five temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8. Then, a subsequent simulation was run to establish an NVE ensemble and measure the properties of the system. Average values for temperature, energy, volume and heat capacity were calculated. This procedure was repeated for a simple cubic lattice with a density of 0.8. An example input script can be found [[:File: Example_script_heatcap_ad5215.in|here]].&lt;br /&gt;
&lt;br /&gt;
The heat capacity of a system is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\mathrm{Var}\left[E\right]}={\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
is the variance in energy. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; term is required because LAMMPS automatically outputs the energy &#039;&#039;&#039;per atom&#039;&#039;&#039;, not the &#039;&#039;&#039;total&#039;&#039;&#039; energy. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 LJfluid phase diag.JPG|thumb|Fig. 1: Phase diagram for the Lennard-Jones fluid]]&lt;br /&gt;
&#039;&#039;&#039;RDF calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Three systems (a liquid, a solid and a gas) were modeled and populated with 3375 atoms each. Temperature and density values were taken from the Lennard-Jones fluid phase diagram reproduced in Fig. 1. These were defined as:&lt;br /&gt;
&lt;br /&gt;
*solid: fcc lattice, temperature 1.2, density 1.2;&lt;br /&gt;
*liquid: sc lattice, temperature 1.2 , density 0.8;&lt;br /&gt;
*vapour: sc lattice, temperature 1.2, density 0.05.&lt;br /&gt;
&lt;br /&gt;
The ensemble was defined as NVT. The timestep for all simulations was set to 0.002. The trajectories of the atoms were recorded and VMD was used to calculate the radial distribution function and its integral from these trajectories. The data was then analysed using Python. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Diffusion coefficient calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The same three systems as above were modeled, this time with 8000 atoms each. The timestep was set to 0.002 and each simulation was run for 5000 steps. The Lennard-Jones cutoff was set to 3.2. The ensemble was defined as NVT. The mean squared displacement (MSD) and the velocity autocorrelation function (VACF) at each step were calculated for all systems. &lt;br /&gt;
The data was then analysed using Python. The MSD plots were fitted to a straight line and the gradient was used to calculate the diffusion coefficient. The VACF integrals were plotted as a function of time and, again, used to calculate the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;MSD&#039;&#039;&#039; is a measure of the deviation of the position of a particle with respect to a reference position over time. It can be thought of as a measure of how much the system moves over time. The MSD is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (r-r_0)^2\rangle=\frac{1}{N}\sum_{n=1}^N (r_n(t) - r_n(0))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient (D) can be calculated from the MSD, using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;VACF&#039;&#039;&#039; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\delta t\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\delta t\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is effectively a measure of how closely related the velocity of a particle is (at time t) to its initial velocity (at time t=0). This correlation is &amp;quot;perturbed&amp;quot; by collisions; at very long times (i.e. when t tends to infinity) we expect the VACF to be zero, as all particles will have collided at least once and their velocities will be uncorrelated.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is proportional to the integral of the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\delta t \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\delta t\right)\right\rangle=\frac{1}{3}\int_0^\infty C\left(\delta t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Results &amp;amp; Discussion==&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
Plots of energy, temperature and pressure vs time were obtained for a timestep value of 0.001. These are reproduced in Fig. 2-4. It can be seen that all three plots reach a &amp;quot;plateau&amp;quot; very quickly; equilibration is almost instantaneous. The values oscillate slightly, as a result of the approximations required by the simulation. These oscillations are however very small (note the scale of the y-axis). &lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|[[File:Ad5215 Ts001 Eng.png|thumb|left|Fig. 2: Energy vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Temp.png|thumb|left|Fig. 3: Temperature vs time (ts 0.001)]]&lt;br /&gt;
|[[File:Ad5215 Ts001 Press.png|thumb|right|Fig. 4: Pressure vs time (ts 0.001)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An important feature of these simulations is the timestep. The shorter the timestep the more &amp;quot;accurate&amp;quot; the simulation, but the more computational power this will require. In this case, plots of the total energy vs time were obtained for all five timestep values (Fig. 5).&lt;br /&gt;
&lt;br /&gt;
[[File:Ad515 Allts energy.png|frame|center|Fig. 5: Energy vs time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
The lowest energy is given by timestep values of 0.001 and 0.0025. These energies are almost identical; the 0.001 energy is lower, but the difference in energies is only 0.005%. In addition to this, for simulating a total time of e.g. 100s, ts = 0.0025 requires 40,000 steps, while ts = 0.001 requires 100,000 steps. Therefore, the 0.0025 timestep is the better choice, as the difference in energies is not large enough to warrant the use of more computational power (as required by the 0.001 timestep). The 0.015 timestep is a poor choice. Not only is the energy the highest of the five, but, unlike in the other four cases, the system does not reach equilibrium and the energy keeps increasing. &lt;br /&gt;
&lt;br /&gt;
Based on this data, further simulations were run using a 0.0025 timestep (unless a different value was required by the lab script).&lt;br /&gt;
&lt;br /&gt;
===Densities and the ideal gas law===&lt;br /&gt;
[[File:Ad5215 densvstemp.png|frame|right|Fig. 6: Plots of density vs temperature comparing experimental and theoretical data]]&lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature for two different pressures are reproduced in Fig. 6. The density given by the ideal gas law was also calculated and plotted on the same graph. &lt;br /&gt;
&lt;br /&gt;
It can be seen that the results of the simulation do not match those given by the theoretical approach. This is because the ideal gas law does not take into account any interaction between particles, i.e. it assumes that the gas behaves ideally. In the Lennard-Jones model the particles experience attractive and repulsive forces; the repulsive forces dominate and cause the system to be more diffuse and thus have a lower simulated density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between theory and simulation increases with increasing pressure because this &amp;quot;pushes&amp;quot; the particles closer together and increases the effect of Lennard-Jones forces. It also increases with decreasing temperature; at low temperatures, the Lennard-Jones forces dominate, while at high temperatures thermal motion is more significant.&lt;br /&gt;
&lt;br /&gt;
===Heat capacities===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities of the two simulated systems are plotted below in Fig. 7.&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Heatcaps.png|frame|right|Fig. 7: Heat capacity variation with temperature]]&lt;br /&gt;
&lt;br /&gt;
===The Radial Distribution Function (RDF)===&lt;br /&gt;
&lt;br /&gt;
The radial distribution function for a solid, liquid and gas is reproduced in Fig. 8. &lt;br /&gt;
[[File:Ad5215 RDFs 3phase.png|frame|center|Fig. 8: RDFs for systems in different phases]].&lt;br /&gt;
&lt;br /&gt;
The RDF shows how a system is arranged, relative to the position of one particle in the system; effectively, it is a measure of long-range order. A peak corresponds to a shell of atoms around the central particle. The intensity of the peak (effectively its integral) is proportional to the number of atoms within this shell. &lt;br /&gt;
&lt;br /&gt;
All three RDFs (vapour, liquid, solid) show an initial peak, but differ in their behaviour at longer distances. The RDF for a system in the gas phase rapidly reaches a value of 1 and plateaus. This is because a gas is, by its very nature, disordered. Atoms are free to move and they tend to disperse, not arrange themselves in shells. The RDF for a liquid oscillates slightly after the initial peak but also plateaus at 1 after a short distance. The initial peak corresponds to a solvation shell around the central particle. The subsequent smaller peaks show that a liquid has some degree of order - the forces between the particles are strong enough to restrict their movement to a degree. &lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 small lat.png|thumb|FCC lattice showing first three neighbouring lattice sites for a central atom (light pink)]]&lt;br /&gt;
&lt;br /&gt;
The RDF for the solid system is different to the other two, as it shows long-range order. It does not plateau but instead shows peaks of decreasing intensity. This can be explained by looking at the structure of the solid crystal. This was defined in the simulation as a face-centred cubic (FCC) lattice, shown in Figure 9. The particles are arranged in shells, at distances which depend on the lattice spacing of the crystal. This can be calculated from the lattice density (1.2).&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF plot correspond to the first three neighbouring sites of the central particle, coloured in blue, purple and green respectively. The lattice spacing and the coordination number of each site can be calculated by considering the geometry of the crystal:&lt;br /&gt;
&lt;br /&gt;
*Shell 1 is found at &amp;lt;math&amp;gt; r_1 = \frac{\sqrt{2}}{2}a = 1.056&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; atoms. &lt;br /&gt;
*Shell 2 is found at &amp;lt;math&amp;gt; r_2 = a = 1.494&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;6&amp;lt;/math&amp;gt;atoms.&lt;br /&gt;
*Shell 3 is found at &amp;lt;math&amp;gt; r_3 = \frac{\sqrt{6}}{2}a = 1.830&amp;lt;/math&amp;gt; and holds &amp;lt;math&amp;gt;24&amp;lt;/math&amp;gt; atoms.&lt;br /&gt;
&lt;br /&gt;
These values agree with those found by the RDF. The coordination numbers match those calculated from the running integral, which has values of 12.15, 17.98 and 42.3 respectively.&lt;br /&gt;
&lt;br /&gt;
===The diffusion coefficient (D)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count.png|Gas phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, large atom count - linear region.png|Gas phase MSD, linear region (large scale)&lt;br /&gt;
File:Ad5215 Gas phase MSD, small atom count.png|Gas phase MSD (small scale)&lt;br /&gt;
File:Ad5215 as phase MSD, small atom count - linear region.png|Gas phase MSD, linear region (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, large atom count.png|Liquid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase MSD, small atom count.png|Liquid phase MSD (small scale&lt;br /&gt;
File:Ad5215 Solid phase MSD, large atom count.png|Solid phase MSD (large scale)&lt;br /&gt;
File:Ad5215 Solid phase MSD, small atom count.png|Solid phase MSD (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ad5215 Velocity Autocorrelation Functions small.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, large scale.png|Gas phase (large scale)&lt;br /&gt;
File:Ad5215 Gas phase VACF Integral, small scale.png|Gas phase (small scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, large scale.png|Liquid phase (large scale)&lt;br /&gt;
File:Ad5215 Liquid phase VACF Integral, small scale.png|Liquid phase (small scale)&lt;br /&gt;
File:AD5215 Solid phase VACF Integral, large scale.png|Solid phase (large scale)&lt;br /&gt;
File:Ad5215 Solid phase VACF Integral, small scale.png|Solid phase (small scale)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;/div&gt;</summary>
		<author><name>Ad5215</name></author>
	</entry>
</feed>