<?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=Wkl13</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=Wkl13"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Wkl13"/>
	<updated>2026-05-18T03:23:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543569</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543569"/>
		<updated>2016-02-26T09:46:30Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} \times {Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 2.99 x 10^{-19} g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 3.00 x 10^{-19} cm^{3}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual &amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume decreases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model breaks down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to higher energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
All simulations were run at high temperatures, (above &amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;), therefore no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif| G(r) plot&lt;br /&gt;
File:Int g(r).tif|&amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot &lt;br /&gt;
File:Int g(r) zoom in.tif| &amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot [zoom-in]&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower compared to solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is very small. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid simulation, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the&amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt;plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC unit cell]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;. The estimation of &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; from the MSD approach is not very accurate, as the values change a lot when different number of atoms were used.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the second term in both the numerator and denumerator converges to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty. Both MSD and VACF method give similar values of estimated diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; (~ &amp;lt;math&amp;gt; 10^{-3}&amp;lt;/math&amp;gt;)  for liquid.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543556</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543556"/>
		<updated>2016-02-26T09:42:50Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} \times {Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 2.99 x 10^{-19} g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 3.00 x 10^{-19} cm^{3}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual &amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume decreases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model breaks down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to higher energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
All simulations were run at high temperatures, (above &amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;), therefore no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif| G(r) plot&lt;br /&gt;
File:Int g(r).tif|&amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot &lt;br /&gt;
File:Int g(r) zoom in.tif| &amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot [zoom-in]&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower compared to solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is very small. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid simulation, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the&amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt;plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC unit cell]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;. The estimation of &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; from the MSD approach is not very accurate, as the values change a lot when different number of atoms were used.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the second term in both the numerator and denumerator converges to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty. Both MSD and VACF method give similar values of estimated diffusion coefficient (~10^{-3})  for liquid.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543541</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543541"/>
		<updated>2016-02-26T09:38:15Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} \times {Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 2.99 x 10^{-19} g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 3.00 x 10^{-19} cm^{3}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual &amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume decreases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model breaks down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to higher energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
All simulations were run at high temperatures, (above &amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;), therefore no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif| G(r) plot&lt;br /&gt;
File:Int g(r).tif|&amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot &lt;br /&gt;
File:Int g(r) zoom in.tif| &amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot [zoom-in]&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower compared to solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is very small. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid simulation, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the&amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt;plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC unit cell]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;. The estimation of &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; from the MSD approach is not very accurate, as the values change a lot when different number of atoms were used.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the second term in both the numerator and denumerator converges to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty. Both MSD and VACF method give similar values of estimated &amp;lt;math&amp;gt;D \left(\text{~} 10^{-3}\right) &amp;lt;/math&amp;gt;  for liquid.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543536</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543536"/>
		<updated>2016-02-26T09:35:58Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} \times {Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 2.99 x 10^{-19} g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 3.00 x 10^{-19} cm^{3}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual &amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume decreases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model breaks down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to higher energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
All simulations were run at high temperatures, (above &amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;), therefore no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif| G(r) plot&lt;br /&gt;
File:Int g(r).tif|&amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot &lt;br /&gt;
File:Int g(r) zoom in.tif| &amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot [zoom-in]&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower compared to solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is very small. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid simulation, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the&amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt;plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC unit cell]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;. The estimation of &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; from the MSD approach is not very accurate, as the values change a lot when different number of atoms were used.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the second term in both the numerator and denumerator converges to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty. Both MSD and VACF method give similar values of estimated &amp;lt;math&amp;gt;D (\text{~} 10^{-3} &amp;lt;/math&amp;gt;  for liquid.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543532</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543532"/>
		<updated>2016-02-26T09:34:06Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} \times {Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 2.99 x 10^{-19} g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 3.00 x 10^{-19} cm^{3}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual &amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume decreases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model breaks down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to higher energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
All simulations were run at high temperatures, (above &amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;), therefore no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif| G(r) plot&lt;br /&gt;
File:Int g(r).tif|&amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot &lt;br /&gt;
File:Int g(r) zoom in.tif| &amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot [zoom-in]&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower compared to solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is very small. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid simulation, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the&amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt;plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC unit cell]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;. The estimation of &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; from the MSD approach is not very accurate, as the values change a lot when different number of atoms were used.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the second term in both the numerator and denumerator converges to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty. Both MSD and VACF method give similar values of estimated &amp;lt;math&amp;gt;D (\approx 10^{-3} &amp;lt;/math&amp;gt;  for liquid.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543529</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543529"/>
		<updated>2016-02-26T09:30:41Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} \times {Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 2.99 x 10^{-19} g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 3.00 x 10^{-19} cm^{3}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual &amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume decreases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model breaks down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to higher energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
All simulations were run at high temperatures, (above &amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;), therefore no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif| G(r) plot&lt;br /&gt;
File:Int g(r).tif|&amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot &lt;br /&gt;
File:Int g(r) zoom in.tif| &amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot [zoom-in]&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower compared to solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is very small. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid simulation, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the&amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt;plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC unit cell]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;. The estimation of &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; from the MSD approach is not very accurate, as the values change a lot when different number of atoms were used.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the second term in both the numerator and denumerator converges to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543523</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543523"/>
		<updated>2016-02-26T09:26:08Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} \times {Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 2.99 x 10^{-19} g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 3.00 x 10^{-19} cm^{3}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual &amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume decreases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model breaks down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to higher energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
All simulations were run at high temperatures, (above &amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;), therefore no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif| G(r) plot&lt;br /&gt;
File:Int g(r).tif|&amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot &lt;br /&gt;
File:Int g(r) zoom in.tif| &amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot [zoom-in]&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower compared to solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is very small. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid simulation, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the&amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt;plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC unit cell]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the second term in both the numerator and denumerator converges to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543517</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543517"/>
		<updated>2016-02-26T09:23:08Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} \times {Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 2.99 x 10^{-19} g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 3.00 x 10^{-19} cm^{3}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual &amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume decreases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model breaks down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to higher energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
All simulations were run at high temperatures, (above &amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;), therefore no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif| G(r) plot&lt;br /&gt;
File:Int g(r).tif|&amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot &lt;br /&gt;
File:Int g(r) zoom in.tif| &amp;lt;math&amp;gt; \int g(r) \mathrm{d}r&amp;lt;/math&amp;gt; plot [zoom-in]&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower compared to solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is very small. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid simulation, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the&amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt;plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC unit cell]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543508</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543508"/>
		<updated>2016-02-26T09:17:31Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} \times {Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 2.99 x 10^{-19} g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 3.00 x 10^{-19} cm^{3}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual &amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume decreases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model breaks down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to higher energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
All simulations were run at high temperatures, (above &amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;), therefore no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543503</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543503"/>
		<updated>2016-02-26T09:14:06Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} \times {Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 2.99 x 10^{-19} g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 3.00 x 10^{-19} cm^{3}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual &amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume decreases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model breaks down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543499</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543499"/>
		<updated>2016-02-26T09:10:31Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} \times {Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 2.99 x 10^{-19} g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 3.00 x 10^{-19} cm^{3}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual &amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543495</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543495"/>
		<updated>2016-02-26T09:06:10Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 7 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} \times {Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 2.99 x 10^{-19} g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 3.00 x 10^{-19} cm^{3}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual &amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543492</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543492"/>
		<updated>2016-02-26T09:02:29Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} \times {Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 2.99 x 10^{-19} g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 3.00 x 10^{-19} cm^{3}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual &amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543489</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543489"/>
		<updated>2016-02-26T08:58:39Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} \times {Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 2.99 x 10^{-19} g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;= 3.00 x 10^{-19} cm^{3}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543488</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543488"/>
		<updated>2016-02-26T08:55:47Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; &#039;&#039;&#039;=3.34 \times 10^{22} &#039;&#039;&#039;&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} \times {Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.99 \times 10^{-19} g&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; &#039;&#039;&#039; = 3.00 \times 10^{-19} cm^{3}&#039;&#039;&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543486</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543486"/>
		<updated>2016-02-26T08:53:15Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} \times 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}}{Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}\times {18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.99 \times 10^{-19} g&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; = 3.00 \times 10^{-19} cm^{3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543481</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543481"/>
		<updated>2016-02-26T08:50:13Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of moles} = \frac {mass}{Mr} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no. of water molecules} =\frac {mass}{Mr} 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {0.997}{18.02} 6.02 \times 10^{23} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; =3.34 \times 10^{22} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {mass of water} = \frac {\text {no. of molecules}}{\text {Avogadro&#039;s constant}}{Mr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {10000}{6.02 \times 10^{23}}{18.02}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =2.99 \times 10^{-19} g&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {Volume} = \frac {mass}{density} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\frac {2.99 \times 10^{-19}} {0.997} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; = =3.00 \times 10^{-19} cm^{3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543477</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543477"/>
		<updated>2016-02-26T08:37:24Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543476</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543476"/>
		<updated>2016-02-26T08:35:48Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543475</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543475"/>
		<updated>2016-02-26T08:33:43Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Well depth &amp;lt;math&amp;gt; \phi \left( r_{eqm}\right) = \phi \left( 2^{1/6} \sigma \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{(\sigma ({2})^{1/6})^{12}} - \frac{\sigma^6}{(\sigma ({2})^{1/6})^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{2^2} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543465</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543465"/>
		<updated>2016-02-26T08:12:08Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of change in total energy. It is found &amp;lt;math&amp;gt; x&amp;lt; 0.2 &amp;lt;/math&amp;gt; does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543461</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543461"/>
		<updated>2016-02-26T08:04:38Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|analytical x(t) against time graph&lt;br /&gt;
File:Eagainstt.png| Energy against time graph&lt;br /&gt;
File:Erroragainstt.png| Error against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543456</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543456"/>
		<updated>2016-02-26T08:01:20Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png&lt;br /&gt;
File:Eagainstt.png&lt;br /&gt;
File:Erroragainstt.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Although the area might be cancelled out when&amp;lt;math&amp;gt; g \left(r\right) &amp;lt;/math&amp;gt; approaches zero, the deficiency at small intervals is not too big. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543315</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543315"/>
		<updated>2016-02-25T23:49:09Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png&lt;br /&gt;
File:Eagainstt.png&lt;br /&gt;
File:Erroragainstt.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number). The first three plateau are read off from the  &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; plot. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! plateau&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543306</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543306"/>
		<updated>2016-02-25T23:45:37Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png&lt;br /&gt;
File:Eagainstt.png&lt;br /&gt;
File:Erroragainstt.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF modified.tif&lt;br /&gt;
File:1m atoms int VACF modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543034</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543034"/>
		<updated>2016-02-25T19:14:58Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 7 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png&lt;br /&gt;
File:Eagainstt.png&lt;br /&gt;
File:Erroragainstt.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif&lt;br /&gt;
File:Temperature against time.tif&lt;br /&gt;
File:Pressure agasint time.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543031</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543031"/>
		<updated>2016-02-25T19:10:41Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png&lt;br /&gt;
File:Eagainstt.png&lt;br /&gt;
File:Erroragainstt.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1, T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543029</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543029"/>
		<updated>2016-02-25T19:03:37Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /*  Introduction  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png&lt;br /&gt;
File:Eagainstt.png&lt;br /&gt;
File:Erroragainstt.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543024</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543024"/>
		<updated>2016-02-25T18:59:21Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.png|thumb|200x200 px|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543016</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543016"/>
		<updated>2016-02-25T18:54:37Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.tif|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543015</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543015"/>
		<updated>2016-02-25T18:52:37Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.tif|thumb|Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543012</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543012"/>
		<updated>2016-02-25T18:50:21Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.tif|thumb| Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543011</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543011"/>
		<updated>2016-02-25T18:48:27Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.tif|thumb|200x200 px| Labelled FCC]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543008</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543008"/>
		<updated>2016-02-25T18:44:22Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:Labelled FCC.tif|thumb|200x200 px|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543004</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=543004"/>
		<updated>2016-02-25T18:41:06Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
[[File:labelled FCC.tif|thumb|200x200 px|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542831</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542831"/>
		<updated>2016-02-25T17:05:26Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! Diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The biggest source of error in the estimates of D from the VACF is the timestep. The limitation appears when we apply trapezium rule for integration. For each small trapeziums, the straight line used is an estimation, in reality, it is either under the curve or extend over it. Deviations appear when large interval are used. Therefore, small timestep should be used. &lt;br /&gt;
&lt;br /&gt;
However, estimation from the VACF is a better method than MSD for simulation. As we can see from the table above, less discrepancy between the simulation and one million atoms. This can be explained straight line fitting with R-squared less than 1 was used in MSD, which has a larger uncertainty.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542629</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542629"/>
		<updated>2016-02-25T16:35:58Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; |\int \text{VACF}| &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
! D&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542609</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542609"/>
		<updated>2016-02-25T16:32:11Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt; \abs \int \text{VACF} &amp;lt;/math&amp;gt;&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
!D&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542556</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542556"/>
		<updated>2016-02-25T16:24:37Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! abs(int VACF)&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542525</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542525"/>
		<updated>2016-02-25T16:20:09Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T* = 2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! abs(int VACF)&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542504</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542504"/>
		<updated>2016-02-25T16:17:57Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T^{*)=2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1&lt;br /&gt;
| 18.2&lt;br /&gt;
| 42.2&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! abs(int VACF)&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542474</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542474"/>
		<updated>2016-02-25T16:15:08Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &lt;br /&gt;
&amp;lt;math&amp;gt; T^{*)=2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, &lt;br /&gt;
no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1 || 18.2||42.2|&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! abs(int VACF)&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542434</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542434"/>
		<updated>2016-02-25T16:11:29Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &amp;lt;math&amp;gt; T^{*)=2.0 = 2 \times 120 K =240 K &amp;lt;/math&amp;gt;, no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1 || 18.2||42.2|&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! abs(int VACF)&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542379</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542379"/>
		<updated>2016-02-25T16:01:52Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &amp;lt;math&amp;gt; T^{*)=2.0 = 2 \times 120 \text{K} =240 \text {K} &amp;lt;/math&amp;gt;, no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1 || 18.2||42.2|&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! abs(int VACF)&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542355</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542355"/>
		<updated>2016-02-25T15:59:19Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &amp;lt;math&amp;gt; T^{*)=2.0 = 2 \times 120 \text{K} =240 \text {K} &amp;lt;/math&amp;gt;, no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1 || 18.2||42.2|&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} f \left(x\right) \, \mathrm{d}x = \frac{1}{2} h \frac[ \left( y_0 + y_n \right)+2\left(y_1 + y_2 +...+y_{n-1} \right) \right] &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\times \text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! abs(int VACF)&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542318</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542318"/>
		<updated>2016-02-25T15:55:35Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &amp;lt;math&amp;gt; T^{*)=2.0 = 2 \times 120 \text{K} =240 \text {K} &amp;lt;/math&amp;gt;, no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1 || 18.2||42.2|&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n} \! f \left(x\right) \mathrm{d}x = \frac{1}{2} h \frac[ \left( y_0 + y_n \right)+2\left(y_1 + y_2 +...+y_{n-1} \right) \right] &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! abs(int VACF)&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03&lt;br /&gt;
| 2.56E-02&lt;br /&gt;
| 3.84E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05&lt;br /&gt;
| 2.81E-03&lt;br /&gt;
| 1.33E-01&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 9.50E-04&lt;br /&gt;
| 8.52E-03&lt;br /&gt;
| 1.28E-02&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 2.90E-05&lt;br /&gt;
| 9.37E-04&lt;br /&gt;
| 4.44E-02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542267</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=542267"/>
		<updated>2016-02-25T15:48:14Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &amp;lt;math&amp;gt; T^{*)=2.0 = 2 \times 120 \text{K} =240 \text {K} &amp;lt;/math&amp;gt;, no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1 || 18.2||42.2|&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule states the area under the curve can be estimated from the summing the trapezium stripes.&lt;br /&gt;
&lt;br /&gt;
For a function &amp;lt;math&amp;gt; y = f(x) &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{0}^{x_n}  f \left(x\right) \mathrm{d}x = \frac{1}{2} h \frac[ \left( y_0 + y_n \right)+2\left(y_1 + y_2 +...+y_{n-1} \right) \right] &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Simulation int VACF.tif&lt;br /&gt;
File:1m atoms int VACF.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since diffusion coefficient can be described as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{1}{3}\int_0^\infty C \left( \tau \right) \mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \approx \frac{1}{3}\text {integral of VACF from trapezium rule} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.50E-04|| 8.52E-03||1.28E-02|&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! abs(int VACF)&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 2.85E-03|| 2.56E-02||3.84E-02|&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 8.71E-05|| 2.81E-03||1.33E-01|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
! solid&lt;br /&gt;
! liquid&lt;br /&gt;
! gas&lt;br /&gt;
|-&lt;br /&gt;
! simulation&lt;br /&gt;
| 9.50E-04|| 8.52E-03||1.28E-02|&lt;br /&gt;
|-&lt;br /&gt;
! 1m atoms&lt;br /&gt;
| 2.90E-05|| 9.37E-04||4.44E-02|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=541967</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=541967"/>
		<updated>2016-02-25T15:06:35Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &amp;lt;math&amp;gt; T^{*)=2.0 = 2 \times 120 \text{K} =240 \text {K} &amp;lt;/math&amp;gt;, no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
File:Int g(r) zoom in.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the number of atoms per unit area (i.e. coordination number).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! peak&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
| 12.1 || 18.2||42.2|&lt;br /&gt;
|-&lt;br /&gt;
! coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 18-12= 6&lt;br /&gt;
| 42-18= 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=541736</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=541736"/>
		<updated>2016-02-25T14:35:38Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to the Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt;, which the ensemble in simulation is also NVT, at low temperature, there are more vacancies in higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, heat capacity is expected to increase. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above &amp;lt;math&amp;gt; T^{*)=2.0 = 2 \times 120 \text{K} =240 \text {K} &amp;lt;/math&amp;gt;, no quantum effect can be observed.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=541579</id>
		<title>Rep:Mod:wkl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:wkl13&amp;diff=541579"/>
		<updated>2016-02-25T14:10:19Z</updated>

		<summary type="html">&lt;p&gt;Wkl13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==&#039;&#039;&#039;&amp;lt;big&amp;gt; Introduction &amp;lt;/big&amp;gt;&#039;&#039;&#039;==&lt;br /&gt;
===Task 1=== &lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, each particles will experience a force. The analytical position x(t) can be described by the function &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error is the absolute of the differences between the Verlet algorithm and the analytical x. The graph below is error plotted against time. &lt;br /&gt;
&lt;br /&gt;
The total energy is the sum of the kinetic and potential energy. &lt;br /&gt;
&amp;lt;ref name=&amp;quot;Principles of Physics&amp;quot;&amp;gt;D. Halliday, R. Resnick, J. Walker, &#039;&#039;Principles of Physics&#039;&#039;, John Wiley &amp;amp; Sons, 9th edn., 2011, ISBN:0470561580&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;E(x) = \frac{1}{2} m v^2+ \frac{1}{2} k x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For timestep 0.1,&lt;br /&gt;
&amp;lt;gallery widths=450px heights=150px&amp;gt;&lt;br /&gt;
File:X(t)againstt.png|x(t) against time graph&lt;br /&gt;
File:Eagainstt.png|Energy against time graph&lt;br /&gt;
File:Erroragainstt.png|Error against time&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy is almost constant. Analytically, it should be constant as energy is always conserved. Since the algorithm approach is used, there are sips in between, hence leading the energy fluctuates slightly.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! local maxima&lt;br /&gt;
! 1st&lt;br /&gt;
! 2nd&lt;br /&gt;
! 3rd&lt;br /&gt;
! 4th&lt;br /&gt;
! 5th&lt;br /&gt;
|-&lt;br /&gt;
!positions&lt;br /&gt;
| 7.58E-04||2.01E-03||3.30E-03||4.60E-03||5.91E-03&lt;br /&gt;
|-&lt;br /&gt;
! time&lt;br /&gt;
| 2.0&lt;br /&gt;
| 4.9&lt;br /&gt;
| 8.0&lt;br /&gt;
| 11.1&lt;br /&gt;
| 14.2&lt;br /&gt;
|}&lt;br /&gt;
[[File:Errorplotmaxagainstt.png|none|300 × 200|left|Error plot max against time]]&lt;br /&gt;
&lt;br /&gt;
A positive linear correlation is found. All the points satisfy into y =0.004x-0.00007 with &amp;lt;math&amp;gt; R^{2}= 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep have been used to explore the percentage of total energy change. It is found x&amp;lt; 0.2 does not change the total energy by more than 1%. Analytically, by the conservation of energy, energy is always conserved. However, in the algorithm approach, the Taylor expansion only expands to the power of 3, in which the calculated value is not exact, hence there is a difference in energy. 1% is the benchmark.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The potential energy is given by the Lennard-Jones equation&amp;lt;ref&amp;gt;ChemWiki, http://chemwiki.ucdavis.edu/Core/Physical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed February 2016)&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;
when &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 ^{6} = \sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the Lennard-Jones interaction is the only source of potential energy,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  - \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + 6\frac{\sigma^{6}}{r^{7}} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48\epsilon \frac{\sigma^{12}}{r^{13}} - 24\epsilon\frac{\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
for &amp;lt;math&amp;gt; r = \sigma &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = 48\epsilon \frac{\sigma^{12}}{\sigma^{13}} - 24\epsilon\frac{\sigma^{6}}{\sigma^{7}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 48 \frac{\epsilon}{\sigma} - 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium &amp;lt;math&amp;gt;r_{eqm}&amp;lt;/math&amp;gt;, the potential energy reaches the minimum, hence &amp;lt;math&amp;gt; \frac{\mathrm{d}U}{\mathrm{d}r}=0 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}r} = - 4\epsilon \left( \frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eqm}^{13}} + 6\frac{\sigma^6}{r_{eqm}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eqm}^{13}} = \frac{6\sigma^6}{r_{eqm}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = {r_{eqm}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eqm} = ({2})^{1/6} \sigma &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =  4\epsilon \left( \sigma^{12} \int_{2\sigma}^\infty \frac{1}{r^{12}} \mathrm{d}r  - \sigma^{6}  \int_{2\sigma}^\infty \frac{1}{r^{6}}\mathrm{d}r \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under standard conditions [101 kPa, 298K] , &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density of water} = 0.997 g ml^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Mr \left(water \right) = 18.02 g mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text {no of moles} = \frac {mass}{Mr} = \frac {\text {no of molecules}}{\text {Avogadro&#039;s constant}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Using periodic boundary condition*)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Periodic boundary condition: if particle moves out of the box &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;, the box will move back and particle will appear in the box again.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = \frac{r^*}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 3.2 \times 0.34 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.09 \mathrm{nm} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Well Depth} = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^{6}}{r^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4 \times 120\ k_B\times \left( 3.2^{-12} {{-}} 3.2^{-6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -6.17 \times 10^{-24} \mathrm{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_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T =  \frac{T^* \epsilon} {k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.5 \times 120 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 180 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Atoms with random starting coordinates have a chance of superposing each other, which is impractical in reality. No two atoms can rest on the same space.&lt;br /&gt;
&lt;br /&gt;
When two atoms are too close (the separation distance is small), according to the Lennard-Jones Potential, the potential energy is very high, as the atoms are repulsing each other. Therefore, the simulation does not fit into real case.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{number density} = \frac{\text{no of atoms}}{\text{volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{number density} = \frac{1}{1.07722^{3}} = 0.800 \left(3 s.f.\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms} = 8 \times {\frac{1}{8}}+ 6 \times {\frac{1}{2}}= 1 + 3 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{volume} = \text{length}^{3} = \frac{\text{no of atoms}}{\text{number density}}= \frac{4}{1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{length}^{3} = 3.\dot{3} &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt; \text{length} = 1.49 \left(\text{in reduced units}\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms per FCC lattice} = 4  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 box creates 1000 unit cells&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{no of atoms created} = 4 \times 1000 = 4000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a mass command. &#039;1&#039; refers to the atom type while &#039;1.0&#039; refers to the mass value. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This command implies only considering the Lennard-Jones potential up to 3.0 atomic units. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|This is a pair coefficient command. The asterick (*) with no values refer all types of atom from 1 to N. The 1.0 1.0 refers to the atom type &#039;1.0&#039; interacting with &#039;1.0&#039;. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;ref name=&amp;quot;LAMMPS manual&amp;quot;&amp;gt;LAMMPS manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed February, 2016)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity-Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For classical Verlet algorithm &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;,the initial conditions only require &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
while velocity Verlet algorithm &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; require &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; only.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep command fixes the time interval for each run. The advantage of using the lines in the top box is flexibility. When the timestep is varied in the future experiment, the run will change automatically, and does not require manual input which could avoid human errors when running the LAMMPS simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For timestep = 0.001&lt;br /&gt;
&amp;lt;gallery widths = 450px heights = 350px&amp;gt; &lt;br /&gt;
File:Energty against time graph.tif|Energy against time graph&lt;br /&gt;
File:Temperature against time.tif|Temperature against time graph&lt;br /&gt;
File:Pressure agasint time.tif|Pressure against time graph&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium, as the energy is almost constant. The fluctuation can be explained by the algorithm used, which only approximates up to the third term of Taylor&#039;s expansion. Equilibrium is reached after 0.3 time units.&lt;br /&gt;
&lt;br /&gt;
A plot of energy against time with different timesteps is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time graph.tif|none|800x500 px|left|Energy against time for various timestep]]&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.015 does not reach equilibrium, as the energy is increasing.It is a &amp;quot;particularly&amp;quot; bad choice. Theoretically, by conservation of energy, the total energy should be a constant, which does not depend on the timestep. The timestep we choose for the experiment should give out the same energy. Among the other simulations, timestep of 0.0025 and 0.001 gives similar energies, which indicates the Verlet-algorithm gives a good approximation in these cases. In addition, in running the simulations,we always aim at longer observation time, which could go for longer time. Therefore, timestep of 0.0025 is the largest to give a result which looks like independent of the time.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.6, 1.8, 2.0, 2.2, 2.4&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^*=2.0, 3.0 &amp;lt;/math&amp;gt; (fluctuate within this range as shown in previous part) were chosen.&lt;br /&gt;
As explained in previous section, timestep of &amp;lt;math&amp;gt; 0.0025 &amp;lt;/math&amp;gt; was chosen.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T     \left(1\right)&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}      \left(2\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{(1)}{(2)}\text{:} \frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 } = \frac{\frac{3}{2} N k_B T}{\frac{3}{2} N k_B \mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma^{2}} =  \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\gamma}=  \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Use the Manual page&amp;lt;ref name=&amp;quot;manual page&amp;quot;&amp;gt;LAMMPS manual page, http://lammps.sandia.gov/doc/fix_ave_time.html, (accessed February, 2016)&amp;lt;/ref&amp;gt;to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The lines indicate:&lt;br /&gt;
{|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nevery, refers to the use values every 100 timesteps.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nrepeat, refers to the number of times to use the input values for calculating the averages. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|Nfreq, calculates the averages every 100000 timesteps. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The values of the temperature is recorded every 100 step. &lt;br /&gt;
&lt;br /&gt;
The values are sampled every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
1000000 will be used to complete the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ideal gas model can also be used to approximate the gases, which assumes&lt;br /&gt;
&lt;br /&gt;
(1) negligible intermolecular forces between the gas molecules&lt;br /&gt;
&lt;br /&gt;
(2) perfectly elastic collisions between the molecule and with the container walls is the only interactions&lt;br /&gt;
&lt;br /&gt;
(3) negligible volume occupied by the molecules compared to container&lt;br /&gt;
&lt;br /&gt;
It can be described mathematically as shown below &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = nRT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where p is pressure, V is the volume, n is number of moles, R is the gas constant and T is temperature. &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; nR = Nk_B &amp;lt;/math&amp;gt;, where N is the number of atoms and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; is the Boltzmann&#039;s constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; k_B =1 (\text{in reduced units})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; pV = NT &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {density} \rho =\frac{p}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from running simulation, density can also be calculated from the the ideal gas law by dividing pressure by temperature. &lt;br /&gt;
&lt;br /&gt;
The error bars are based on standard deviations &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; from the simulation, while &amp;lt;math&amp;gt; \sigma \left( \rho \right) &amp;lt;/math&amp;gt; was calculated using the following equation &amp;lt;ref name= &amp;quot;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&amp;quot; &amp;gt; I. HUGHES, T. HASE, &#039;&#039;Measurements and their Uncertainties A Practical Guide to Modern error Analysis&#039;&#039;, Oxford University Press, OXFORD, 2010, ISBN:9780199566334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sigma \left( \rho\right) = \sqrt{\left( \frac{\sigma \left(p \right)}{p} \right) ^{2} +\left( \frac{\sigma \left(T \right)}{T} \right)^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming positive and negative error bar is the same in magnitude. The error bar stimulated density are too small (~&amp;lt;math&amp;gt; 10^{-2}&amp;lt;/math&amp;gt;)to be shown on the graph.  &lt;br /&gt;
&lt;br /&gt;
Here is the plot of density as a function of temperature in two different (controlled) pressure, under simulation and ideal gas approximation.&lt;br /&gt;
&lt;br /&gt;
[[File:Density against temp revised.tif|none|800x500 px|left|Density against temp revised]]&lt;br /&gt;
&lt;br /&gt;
The stimulated density is lower than the calculated. This phenomenon can be explained by the assumption of gas molecules do not interact with each other in the ideal gas approximation model. In a fixed volume, more gas molecules can be found as the molecules do not repel with each other, hence density is higher. &lt;br /&gt;
&lt;br /&gt;
The plot shows &lt;br /&gt;
&lt;br /&gt;
(1)&#039;&#039;Density is inversely proportional to temperature.&#039;&#039; &lt;br /&gt;
&#039;&#039;Negative gradients were found in the density against temperature graph.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When temperature increases, the average kinetic energy increases, molecules are more energetic, and moving at a higher speed. In a fixed volume, fewer molecules are found (i.e. density decreases).&lt;br /&gt;
&lt;br /&gt;
(2)&#039;&#039;Discrepancy in density increases, as pressure increases.&#039;&#039;&lt;br /&gt;
&#039;&#039;Densities were observed to be higher at &amp;lt;math&amp;gt; p^{*} = 3.0 &amp;lt;/math&amp;gt;than &amp;lt;math&amp;gt; p^{*} = 2.0 &amp;lt;/math&amp;gt;(while other variables kept constant). The discrepancy between the simulation and the ideal gas model (i.e. less exact) increases when &amp;lt;math&amp;gt; p^{*} &amp;lt;/math&amp;gt; increases from 2.0 to 3.0.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When pressure increases, molecules are forced closer together and interact stronger. Consequently, volume at a given temperature is decreased, as the number of atoms N is fixed in the simulation (&amp;lt;math&amp;gt; pV = NT = const &amp;lt;/math&amp;gt;). Density (&amp;lt;math&amp;gt;\rho =\frac{N}{V}&amp;lt;/math&amp;gt;)at the given temperature increases, as the volume increases. There will be more interaction between molecules which has been neglected in the ideal gas assumption. Hence, the ideal gas model starts to break down, larger discrepancy will be observed.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Input script for &amp;lt;math&amp;gt; \rho^{*} = 0.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; T^{*} =2.0 &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density atoms vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;total energy^2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;heat capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;number of atoms: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcappervolagainsttemp modified.tif|none|800x500 px|left|Heatcappervolagainsttemp_modified]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity at constant volume per unit volume against time plot is shown above.&lt;br /&gt;
&lt;br /&gt;
The internal energy &amp;lt;math&amp;gt;U &amp;lt;/math&amp;gt; varies with temperature and volume. &lt;br /&gt;
&lt;br /&gt;
Heat capacity at constant volume &amp;lt;math&amp;gt;C_v &amp;lt;/math&amp;gt; is defined as heat energy per unit temperature. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is fixed, and we are interested in variation with the temperature. Since heat capacity is proportional to volume, we normalise the system to which is invariant with the size for comparison&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Higher &amp;lt;math&amp;gt;\frac{C_V}{V} &amp;lt;/math&amp;gt; at specific temperature was observed in &amp;lt;math&amp;gt;\rho^{*} = 0.8 &amp;lt;/math&amp;gt; than &amp;lt;math&amp;gt;\rho^{*} = 0.2 &amp;lt;/math&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be explained molecules are closer at higher density. Higher potential energy is experienced as resulted from stronger interaction between molecules. Hence, the internal energy increases, consequently the thermal energy. Eventually, the &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; increases. &lt;br /&gt;
&lt;br /&gt;
Another observation which out of expectation was also found. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Lower &amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt;, as temperature increases.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac {C_V}{V} &amp;lt;/math&amp;gt; is expected to increase, as temperature increases, the average kinetic energy increases. &lt;br /&gt;
&lt;br /&gt;
[[File:Shottky Anomaly.png|thumb|250x150px|right|Schottky Anomaly]]&lt;br /&gt;
&lt;br /&gt;
The Schottky anomaly &amp;lt;ref name=&amp;quot;Schottky  anomaly&amp;quot;&amp;gt; The Schottky Anomaly, https://commons.wikimedia.org/wiki/File:Shottky_Anomaly.png#/media/File:Shottky_Anomaly.png, (accessed February, 2016)&amp;lt;/ref&amp;gt; can be used to explain the phenomenon, as the ensemble in simulation is NVT. &lt;br /&gt;
At low temperature, there are more vacancies in the higher energy states. Molecules are more likely to be populated from lower energy states to high energy states. Hence, higher heat capacity. &lt;br /&gt;
&lt;br /&gt;
At high temperature (all simulations were run above the critical temperature), molecules are more likely to be found at higher energy level, the system is saturated, less likely to absorb energy, hence the heat capacity decreases.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulations were run under these conditions,&lt;br /&gt;
&lt;br /&gt;
solid &amp;lt;math&amp;gt; \rho = 1.2, T*= 0.8, \text {fcc}&amp;lt;/math&amp;gt;;&lt;br /&gt;
liquid  &amp;lt;math&amp;gt; \rho = 0.8, T*= 1.2 &amp;lt;/math&amp;gt;; and&lt;br /&gt;
gas &amp;lt;math&amp;gt; \rho = 0.1 T*= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Radial distribution function &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; describes the variation of density of particles based on the distance from the reference point. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=300px&amp;gt;&lt;br /&gt;
File:G(r) plot.tif&lt;br /&gt;
File:Int g(r).tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid, atoms are tightly packed. Atoms are usually arranged in a regular manner. The peaks occur at the respective distance on the g(r) plot show the position of atoms. As we can see from the graph, more peaks are found at shorter distance. Solid has the highest density among three states. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually fluctuates between 1. &lt;br /&gt;
&lt;br /&gt;
In liquid, atoms are close together, but further apart than atoms in solids. Atoms are arranged irregularly. Less peaks are observed while the magnitude of the peak is lower than solid. Density of liquid is lower than solid.  The peaks are located at distance shorter than 4 unit distance. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; eventually approaches 1. &lt;br /&gt;
&lt;br /&gt;
In gas, atoms are very far apart. Only one peak at less than 2 unit distance on &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; plot, is observed. &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; approaches 1 after 2 unit distance. The &amp;lt;math&amp;gt; \int g(r) &amp;lt;/math&amp;gt; is almost 0. This indicates there is no predictable arrangement of the system.&lt;br /&gt;
&lt;br /&gt;
In the solid case, face-centred cubic structure was adopted. There are three major types of shortest distance in the unit cell. The respective distance can be found from the peaks on the g(r) plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_2 = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_3 = 1.825 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; y &amp;lt;/math&amp;gt; be the length of the side of unit cell. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = b = c = y (\text{cubic}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} + y^{2} = \left( 2 d_1 \right)^{2} \text{(Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2 y^{2} = 4 d_1^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y^{2} = 2 \left( 1.025 \right)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {2 \left( 1.025 \right)^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; d_1 = 1.4496 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = d_2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.475 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \left[ \left( \frac {y}{2} \right)^{2} + y^{2} \right] + \left( \frac {y}{2} \right)^{2} = d_3^{2} \text{ (Pythagoras&#039;s theorem)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {y^{2}}{4} + y^{2}  + \frac {y^{2}}{4} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {3 y^{2}}{2} + y^{2} = d_3 ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 d_3 ^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = \sqrt {\frac {2 1.825^{2}}{3}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; y = 1.4901 \text{(5 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{ average lattice spacing} = \frac {1.4496 + 1.475 + 1.4901}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 1.47 \text{(3 s.f.)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The conditions for solid, liquid and gas simulations is the same as the previous part. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=450px heights=350px&amp;gt;&lt;br /&gt;
File:Solid modified.tif&lt;br /&gt;
File:Liquid modified.tif&lt;br /&gt;
File:Vapour modified.tif&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be defined from the mean squared displacement. &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;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} = 6 D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the gradient of the &amp;quot;total&amp;quot; MSD against timestep gives &amp;lt;math&amp;gt; 6D &amp;lt;/math&amp;gt;, a straight line graph is expected. Hence, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; can be estimated from the slope of linear fitting. &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is a measure of the rate of molecular motion&amp;lt;ref name = &amp;quot;Dynamic light scattering&amp;quot;&amp;gt; P.A.Atkins, &#039;&#039;Physical Chemistry&#039;&#039;, Oxford University Press, OXFORD, 8th edn., 2006.&amp;lt;/ref&amp;gt;. The more mobile the atoms in system, higher &amp;lt;math&amp;gt; D = \frac{1}{6} \text{grad.}&amp;lt;/math&amp;gt; (larger slope in &amp;quot;total&amp;quot; MSD plot) should be observed. &lt;br /&gt;
&lt;br /&gt;
{|class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Gradient (simulation)&lt;br /&gt;
! D (simulation)&lt;br /&gt;
! Gradient (1 million atoms)&lt;br /&gt;
! D (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!solid&lt;br /&gt;
| 2.53E-8&lt;br /&gt;
| 4.22E-9&lt;br /&gt;
| 5.27E-8&lt;br /&gt;
| 8.78E-9&lt;br /&gt;
|-&lt;br /&gt;
!liquid&lt;br /&gt;
| 1.02E-3&lt;br /&gt;
| 1.70E-4&lt;br /&gt;
| 1.05E-3&lt;br /&gt;
| 1.75E-4&lt;br /&gt;
|-&lt;br /&gt;
!vapour&lt;br /&gt;
| 1.82E-2&lt;br /&gt;
| 3.03E-3&lt;br /&gt;
| 3.05E-2&lt;br /&gt;
| 5.08E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases as the the density of system increases (solid --&amp;gt; liquid --&amp;gt; gas). When the number of atoms in the simulation increases (simulation --&amp;gt; 10000 atoms vs 1 million atoms),&amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; also increases. In addition, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases more significantly as the density decreases (i.e. atoms tend to be in more random motion), esp from liquid to gas, &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; increases in the order of magnitude from &amp;lt;math&amp;gt; 10^{-9} &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; 10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For 1D harmonic oscillator,&lt;br /&gt;
&lt;br /&gt;
The displacement can be defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega \mathit{t} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac {\mathrm{d}x\left(t\right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac {\mathrm{d}A\cos\left(\omega \mathit{t} \right)}{\mathrm{d}\mathit{t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A \omega -\sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A \omega \sin\left(\omega\mathit{t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} A^{2} \omega^{2} \sin\left(\omega\mathit{t}\right) \sin\left(\omega \left(\mathit{t}+\tau\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A^{2} \omega^{2}\left( \sin\left(\omega\mathit{t}\right)\right)^{2}\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt; \sin(a)\sin(b) = \frac{\left( cos (a-b) - cos (a+b) \right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \frac{1}{2} \times \left( \cos(\omega\mathit{t}-\omega\mathit{t}-\omega\tau)- \cos(\omega\mathit{t}+\omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} \times ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac{\int_{-\infty}^{\infty} \left( \cos(-\omega\tau)- \cos(2 \omega\mathit{t}+\omega\tau) \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  ( 1- \cos(2\omega\mathit{t})\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)- \frac {1}{2 \omega} \left( \sin (2 \omega R+\omega\tau)- \sin(-2 \omega R+ \omega\tau) \right)} {2R - \frac {1}{2 \omega} 2\sin (2\omega R)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \lim_{R \to {\infty}} \frac { 2R\cos(-\omega\tau)} {2R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.tif|none|800x500px|left|Velocity autocorrelation function]]&lt;br /&gt;
&lt;br /&gt;
The plot shows the velocity autocorrelation function (VACF) as a function of temperature in 1D harmonic oscillator, liquid and solid simulations. &lt;br /&gt;
The global minima occur at -1.30943 and -0.15104 for solid and liquid respectively. Since velocity is a vector quantity, the negative value indicates the change in direction. &lt;br /&gt;
&lt;br /&gt;
The velocities (solid and liquid) generated from the simulation do not retain to that speed after reaching minima. After collision, the atom loses its initial velocity and moves round in random Brownian motion, which eventually will decay to zero. In a denser system (solids), the velocity correlation decays quicker to zero. System with fixed atomic positions (solid) diffuses faster after the initial simulation. This is analogous to a very damped oscillation. In liquid, atoms experience destructive intermolecular forces from the Lennard Jones potential, which takes longer time to decay. The harmonic oscillator, a single atomic system, never decays. It undergoes the simple harmonic motion with constant magnitude of amplitude and frequency. The change in VACF of the harmonic oscillator is the natural change in speed in the interchange between kinetic and potential energy.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Wkl13</name></author>
	</entry>
</feed>